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/684415 | -1 | I'd like to position two TikZ pictures side by side, with the captions "Before" and "After", respectively. How can I do this?
I tried placing the TikZ pictures inside `figure` environments, for the captions, and placing the `figure` environments inside a `tblr`, for the positioning, as follows.
```
\documentclass{article}
\usepackage{tabularray}
\usepackage{float}%For the 'H' option
\usepackage{tikz}
\begin{document}
\begin{tblr}{}
\begin{figure}[H]
\centering
\tikz \draw (0,0) circle (1);
\caption{Before}
\end{figure}
&
\begin{figure}[H]
\centering
\tikz \draw (0,0) rectangle (1,1);
\caption{After}
\end{figure}
\end{tblr}
\end{document}
```
Unfortunately, this code fails to compile in Overleaf with the 2022 LuaLaTeX compiler.
How can I fix the code to achieve the objective stated in the beginning of this post?
| https://tex.stackexchange.com/users/21685 | How to create captioned TikZ pictures inside a tblr? | false | Assuming that images can be arbitrary, so beside of `tikzpicture` I also use ˙example-image-duck`, which is available to anyone:
```
\documentclass{article}
\usepackage[export]{adjustbox} % for "valign", also load graphicx
\usepackage{tabularray}
\UseTblrLibrary{counter, varwidth} % <===
\usepackage[font=small, labelfont=bf]{caption}
\begin{document}
\begin{figure}[htp]
\begin{tblr}{colspec={X[c] X[c]},
measure = vbox % <----
}
\includegraphics[width=\linewidth,valign=t]{example-image-duck}
\caption{Before.}
&
\includegraphics[width=\linewidth,valign=t]{example-image-duck}
\caption{After.}
\end{tblr}
\end{figure}
\begin{figure}[htp]
\begin{tblr}{colspec={X[c] X[c]},
measure = vbox
}
\tikz \draw (0,0) circle (1);
\caption{Before.}
&
\tikz \draw (0,0) rectangle (1,1);
\caption{After.}
\end{tblr}
\end{figure}
\end{document}
```
**Note:**
* floats should not be inserted inside any box/table cell
* for inserting `\caption` in cells you need to load library `varwidth` and add to table preamble option `measure = vbox`
* that numbering of figure are correct, the library `counter` is needed
| 3 | https://tex.stackexchange.com/users/18189 | 684421 | 317,517 |
https://tex.stackexchange.com/questions/684405 | 1 | I have a set of lecture notes and each lecture is contained within a subfile, and the main file contains a list of all the lectures like so:
```
\subfile{lec-1}
\subfile{lec-2}
% more files labeled lec-X
\subfile{lec-26}
```
Every time I need to set the view to certain lectures/the full document I would need to comment/uncomment manually, and I would like something that is a bit less tedious.
Are there any better ways to organize this? Perhaps a simple foreach loop would work, but are there any more elegant solutions? Thanks!
| https://tex.stackexchange.com/users/249246 | Better way to subfile multiple files with similar titles? | false | You could use a `\foreach` from `pgffor` package for not repeating all the `\subfile`.
With `multiaudience` you can set two (or more) "audiences", that is versions of the document.
In my MWE, `complete` print everything, and `onlysome` prints subfiles 1, 3, and 4.
You can choose which one to use by simply commenting/uncommenting one of these two lines:
```
%\DefCurrentAudience{onlysome}
\DefCurrentAudience{complete}
```
Here is the complete MWE:
```
\documentclass{book}
\usepackage{pgffor}
\usepackage{multiaudience}
\SetNewAudience{complete}
\SetNewAudience{onlysome}
\usepackage{subfiles}
\begin{document}
%\DefCurrentAudience{onlysome}
\DefCurrentAudience{complete}
\begin{shownto}{complete}
\foreach \ind in {1,...,26}
{\subfile{lec-\ind}}
\end{shownto}
\begin{shownto}{onlysome}
\foreach \ind in {1,3,4}
{\subfile{lec-\ind}}
\end{shownto}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/101651 | 684423 | 317,518 |
https://tex.stackexchange.com/questions/684386 | 1 | After getting to the solution with `longtable` I was finding I needed `longtabu` because I want to use `X` columns.
However, using `longtabu` the sum does break and shows double to correct value.
And when using a `X`column it adds even more to it.
Is that because the table is compiled multiple times and therefore also running the adding part multiple times? Is there another way to solve this with `expl3` or do I just need to use `longtable` and then manually calculate the `X` column instead to make the table fill the whole `textwidth`?
```
\documentclass[parskip=full]{scrlttr2}
\renewcommand\familydefault{\sfdefault}
\usepackage[defaultsans, scale=0.9]{opensans}
\usepackage[check-declarations]{expl3}
\ExplSyntaxOn
\NewDocumentCommand{\newtime}{m}
{
\fp_new:c { g_timecalc_time_#1_fp }
}
\newtime{default} % initialize one
\NewDocumentCommand{\resettime}{O{default}}{
\fp_gset:cn { g_timecalc_time_#1_fp } { \fpeval{0} }
}
% \addtime* will also show the added time
\NewDocumentCommand{\addtime}{sO{default}mm}
{
\timecalc_time_add:nnn { #2 } { #3 } { #4 }
% with \addtime* also show what's been added
\IfBooleanT{#1}{#3\,\textup{#4}}
}
\NewDocumentCommand{\strtime}{O{default}m}
{
\timecalc_time_str:nn { #1 } { #2 }
}
\int_new:N \l__timecalc_time_days_int
\int_new:N \l__timecalc_time_hours_int
\int_new:N \l__timecalc_time_minutes_int
\cs_new_protected:Nn \timecalc_time_add:nnn
{
\str_case:nnF { #3 }
{
{h}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 * 60 } }
{d}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 * 60 * 24 } }
{min}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 } }
}
{\ERROR}
}
\cs_new_protected:Nn \int_div_mod:nnn {
\int_set:Nn #3
{ \int_div_truncate:nn { #1 } { #2 } }
\int_set:Nn #1
{ \int_mod:nn { #1 } { #2 } }
}
\cs_new_protected:Nn \timecalc_time_str:nn
{
% round to an integral number of minutes
\int_set:Nn \l__timecalc_time_minutes_int
{ \fp_eval:n { round( \fp_use:c { g_timecalc_time_#1_fp }, 0 ) } }
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{d}
}
{%yes
% compute and remove the number of days
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{1440}{\l__timecalc_time_days_int}
% now print the days
\int_compare:nTF { \l__timecalc_time_days_int > 0 }
{ \int_eval:n { \l__timecalc_time_days_int }\,\textup{d}\; }
{% no days
\unkern
}
}{} % no
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{h} ||
\str_if_eq_p:nn{#2}{d}
}
{%yes
% compute and remove the number of hours
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{60}{\l__timecalc_time_hours_int}
% now print the hours
\int_compare:nTF { \l__timecalc_time_hours_int > 0 }
{
\int_eval:n { \l__timecalc_time_hours_int }\,\textup{h}\;
}
{% no hours
\unkern
}
}{} % no
% now print the minutes
\int_compare:nTF { \l__timecalc_time_minutes_int > 0 }
{
\int_eval:n { \l__timecalc_time_minutes_int }\,\textup{min}
}
{% no minutes
0\,min%\unkern
}
}
\ExplSyntaxOff
\usepackage{longtable}[=v4.13]
\usepackage{tabu}%
\begin{document}
\begin{longtable}{r}
\textbf{time}
\endhead
\addtime*{30}{min}\\
\addtime*{4}{h} \\
\end{longtable}
This leads to a complete time of \strtime{h}.
\resettime
Current time: \strtime{h}.
\begin{longtabu}{r}%
\textbf{time}
\endhead
\addtime*{30}{min}\\
\addtime*{4}{h} \\
\end{longtabu}%
This leads to a complete time of \strtime{h}.
\resettime
Current time: \strtime{h}.
\begin{longtabu}{X}%
\textbf{time}
\endhead
\addtime*{30}{min}\\
\addtime*{4}{h} \\
\end{longtabu}%
This leads to a complete time of \strtime{h}.
\end{document}
```
| https://tex.stackexchange.com/users/281557 | Summing does not work in longtabu | true | ### edited to unify coding style and use OP's initial code
```
\documentclass[parskip=full]{scrlttr2}
\renewcommand\familydefault{\sfdefault}
\usepackage[defaultsans, scale=0.9]{opensans}
\usepackage[check-declarations]{expl3}
% \newcommand\tabudoonlyatlast{%
% \ifx\tabu@savecounters\relax\expandafter\@gobble\else\expandafter\@firstofone\fi
% }
\ExplSyntaxOn
% WARNING! THIS USES \tex_relax:D WHICH IS FORBIDDEN (D = DoNotUse)
% But I have no idea what should take its place.
% Not "\relax"? that would be way too lenient.
\makeatletter
\NewDocumentCommand{\mrCarnivoreprotect}{m}{
\tl_if_eq:NNTF { \tabu@savecounters } { \tex_relax:D }
{ }
{ #1 }
}
\makeatother
\NewDocumentCommand{\newtime}{m}
{
\fp_new:c { g_timecalc_time_#1_fp }
}
\newtime{default} % initialize one
\NewDocumentCommand{\resettime}{O{default}}{
\fp_gset:cn { g_timecalc_time_#1_fp } { \fpeval{0} }
}
% \addtime* will also show the added time
\NewDocumentCommand{\addtime}{sO{default}mm}
{
\timecalc_time_add:nnn { #2 } { #3 } { #4 }
% with \addtime* also show what's been added
\IfBooleanT{#1}{#3\,\textup{#4}}
}
\NewDocumentCommand{\strtime}{O{default}m}
{
\timecalc_time_str:nn { #1 } { #2 }
}
\int_new:N \l__timecalc_time_days_int
\int_new:N \l__timecalc_time_hours_int
\int_new:N \l__timecalc_time_minutes_int
\cs_new_protected:Nn \timecalc_time_add:nnn
{
\str_case:nnF { #3 }
{
{h}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 * 60 } }
{d}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 * 60 * 24 } }
{min}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 } }
}
{\ERROR}
}
\cs_new_protected:Nn \int_div_mod:nnn {
\int_set:Nn #3
{ \int_div_truncate:nn { #1 } { #2 } }
\int_set:Nn #1
{ \int_mod:nn { #1 } { #2 } }
}
\cs_new_protected:Nn \timecalc_time_str:nn
{
% round to an integral number of minutes
\int_set:Nn \l__timecalc_time_minutes_int
{ \fp_eval:n { round( \fp_use:c { g_timecalc_time_#1_fp }, 0 ) } }
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{d}
}
{%yes
% compute and remove the number of days
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{1440}{\l__timecalc_time_days_int}
% now print the days
\int_compare:nTF { \l__timecalc_time_days_int > 0 }
{ \int_eval:n { \l__timecalc_time_days_int }\,\textup{d}\; }
{% no days
\unkern
}
}{} % no
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{h} ||
\str_if_eq_p:nn{#2}{d}
}
{%yes
% compute and remove the number of hours
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{60}{\l__timecalc_time_hours_int}
% now print the hours
\int_compare:nTF { \l__timecalc_time_hours_int > 0 }
{
\int_eval:n { \l__timecalc_time_hours_int }\,\textup{h}\;
}
{% no hours
\unkern
}
}{} % no
% now print the minutes
\int_compare:nTF { \l__timecalc_time_minutes_int > 0 }
{
\int_eval:n { \l__timecalc_time_minutes_int }\,\textup{min}
}
{% no minutes
0\,min%\unkern
}
}
\ExplSyntaxOff
\usepackage{longtable}[=v4.13]
\usepackage{tabu}%
\begin{document}
\begin{longtable}{r}
\textbf{time}
\endhead
\addtime*{30}{min}\\
\addtime*{4}{h}\\
\end{longtable}
This leads to a complete time of \strtime{h}.
\resettime
Current time: \strtime{h}.
\begin{longtabu}{r}%
\textbf{time}
\endhead
\mrCarnivoreprotect{\addtime*{30}{min}}\\
\mrCarnivoreprotect{\addtime*{4}{h}}\\
\end{longtabu}%
This leads to a complete time of \strtime{h}.
\resettime
Current time: \strtime{h}.
\begin{longtabu}{X}%
\textbf{time}
\endhead
\mrCarnivoreprotect{\addtime*{30}{min}}\\
\mrCarnivoreprotect{\addtime*{4}{h}}\\
\end{longtabu}%
This leads to a complete time of \strtime{h}.
\end{document}
```
produces
### original version
tabu does multiple passes (or may do), perhaps 2 or 3 even more perhaps (not sure). I looked quickly at its code but did not find a conditional one can query. However it looks as if the `\tabu@savecounters` is set to `\relax` after having being used during tabu preliminary and is reset for final pass (probably from exiting a group). Hence this.
```
\documentclass[parskip=full]{scrlttr2}
\renewcommand\familydefault{\sfdefault}
\usepackage[defaultsans, scale=0.9]{opensans}
\usepackage{longtable}[=v4.13]
\usepackage{tabu}%
\makeatletter
\newcommand\tabudoonlyatlast{%
\ifx\tabu@savecounters\relax\expandafter\@gobble\else\expandafter\@firstofone\fi
}
\makeatother
\begin{document}
\def\x{0}
\def\stepx{\xdef\x{\the\numexpr\x+1}}
Value of x: \x.
\begin{longtabu}{r}%
\textbf{time}
\endhead
initial x = \x\\
final x = \tabudoonlyatlast{\stepx}\x
\end{longtabu}
Value of x: \x.
\end{document}
```
This being said, we are thus modifying the output at the final typesetting pass and it is possible that we mess up tabu meaurements (say when we go from 9 to 10). So it should be used with the variable thing rendered in fixed-width box, to be sure.
| 1 | https://tex.stackexchange.com/users/293669 | 684424 | 317,519 |
https://tex.stackexchange.com/questions/684415 | -1 | I'd like to position two TikZ pictures side by side, with the captions "Before" and "After", respectively. How can I do this?
I tried placing the TikZ pictures inside `figure` environments, for the captions, and placing the `figure` environments inside a `tblr`, for the positioning, as follows.
```
\documentclass{article}
\usepackage{tabularray}
\usepackage{float}%For the 'H' option
\usepackage{tikz}
\begin{document}
\begin{tblr}{}
\begin{figure}[H]
\centering
\tikz \draw (0,0) circle (1);
\caption{Before}
\end{figure}
&
\begin{figure}[H]
\centering
\tikz \draw (0,0) rectangle (1,1);
\caption{After}
\end{figure}
\end{tblr}
\end{document}
```
Unfortunately, this code fails to compile in Overleaf with the 2022 LuaLaTeX compiler.
How can I fix the code to achieve the objective stated in the beginning of this post?
| https://tex.stackexchange.com/users/21685 | How to create captioned TikZ pictures inside a tblr? | false | If the captions' sole purpose is to attach to the pictures a brief description, and you don't need labels and figure tables, etc., you could add the captions in another row.
```
\documentclass{article}
\usepackage{tabularray}
\usepackage{tikz}
\begin{document}
\begin{tblr}{cells={halign=c}}
\tikz \draw (0,0) circle (1);
&
\tikz \draw (0,0) rectangle (1,1);
\\
Before
&
After
\end{tblr}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/21685 | 684428 | 317,521 |
https://tex.stackexchange.com/questions/684418 | 1 |
```
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{array}
\usepackage{float}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }
\usepackage{enumitem}
\usepackage{nameref}
\usepackage{amsfonts,amsmath,amssymb,amsthm,etoolbox}
\usepackage[version=4]{mhchem}
\usepackage{stmaryrd}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan,}
\urlstyle{same}
\usepackage[vmargin=1.0in, left=1in, right=1.in,
footskip=2.0cm, % footskip margin
]{geometry}
\begin{document}
\begin{table}[]
\caption{}
\label{tab:my-table}
\begin{tabular}{llllllllll}
\multirow{3}{*}{Chrom Length} & \multicolumn{9}{l}{Success Rate (\%)} \\
& \multicolumn{3}{l}{SRP 1} & \multicolumn{3}{l}{SRP 2} & \multicolumn{3}{l}{SRP 3} \\
& Contr. Opr. & Slice Cross. & Comb. & Contr. Opr. & Slice Cross. & Comb. & Contr. Opr. & Slice Cross. & Comb. \\
11 & 40 & 88 & 85 & 0 & 0 & 0 & 5 & 3 & 8 \\
\multirow{3}{*}{15} & 56 & 94 & 97 & 0 & 0 & 0 & 4 & 10 & 5 \\
& 61 & 99 & 100 & 0 & 7 & 6 & 3 & 6 & 13 \\
& 62 & 100 & 98 & 0 & 23 & 21 & 5 & 8 & 12 \\
\multirow{3}{*}{27} & 58 & 97 & 100 & 0 & 38 & 37 & 3 & 13 & 14 \\
& 65 & 100 & 98 & 2 & 41 & 44 & 4 & 14 & 13 \\
& 69 & 99 & 99 & 6 & 52 & 42 & 7 & 7 & 10 \\
39 & 72 & 97 & 99 & 10 & 49 & 57 & 7 & 8 & 8 \\
43 & 74 & 94 & 96 & 7 & 57 & 59 & 3 & 12 & 8 \\
47 & 66 & 94 & 95 & 9 & 49 & 62 & 5 & 11 & 13 \\
51 & 79 & 97 & 94 & 10 & 62 & 61 & 5 & 8 & 9 \\
55 & 80 & 96 & 97 & 11 & 70 & 58 & 5 & 7 & 6 \\
59 & 73 & 96 & 98 & 12 & 59 & 51 & 0 & 7 & 10 \\
63 & 75 & 98 & 95 & 17 & 60 & 68 & 3 & 8 & 7 \\
67 & 74 & 99 & 96 & 21 & 66 & 63 & 4 & 8 & 4 \\
71 & 78 & 98 & 93 & 20 & 59 & 68 & 0 & 3 & 4 \\
75 & 75 & 96 & 96 & 16 & 61 & 72 & 3 & 3 & 9 \\
79 & 78 & 100 & 99 & 16 & 61 & 58 & 1 & 8 & 8 \\
83 & 69 & 96 & 98 & 18 & 74 & 71 & 1 & 5 & 11 \\
87 & 77 & 94 & 98 & 24 & 70 & 56 & 1 & 7 & 9 \\
91 & 72 & 97 & 92 & 20 & 67 & 68 & 4 & 5 & 4 \\
95 & 76 & 97 & 93 & 20 & 52 & 61 & 0 & 7 & 8 \\
99 & 82 & 91 & 95 & 24 & 68 & 63 & 4 & 4 & 2 \\
103 & 77 & 94 & 98 & 25 & 56 & 61 & 1 & 7 & 6 \\
Average & 70.33 & 96.29 & 96.21 & 12.00 & 50.04 & 50.29 & 3.25 & 7.46 & 8.38
\end{tabular}
\end{table}
\end{document}
```
| https://tex.stackexchange.com/users/289569 | How to set the big table within page margins? | false | Like this?
(red lines show page layout)
* Column headers are to wide, write thwo in two lines!
* By use of `tblr` of `tabularray` with libraries `booktabs` and `siunitx`:
```
\documentclass[11pt,a4paper]{report}
\usepackage[margin=1.0in,
footskip=2.0cm, % footskip margin
]{geometry}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum} % for dummy text
%---------------------------------------------------------------%
\usepackage[T1]{fontenc}
\usepackage[skip=1ex]{caption}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\begin{document}
\lipsum[66]
\begin{table}[ht]
\caption{}
\label{tab:my-table}
\begin{tblr}{colspec = {@{} *{2}{X[c, si={table-format=2.0}]}
*{2}{X[c, si={table-format=3.0}]}
*{6}{X[c, si={table-format=2.0}]}
@{} },
cell{2}{2,5,8} = {c=3}{c},
row{1-3,Z} = {guard,b},
rowsep = 1pt
}
\toprule
\SetCell[r=3]{l} Chrome Length
& \SetCell[c=9]{c} Source rate
& & & & & & & & \\
\cmidrule{2-10}
& SRP 1
& & & SRP 2
& & & SRP 2
& & \\
\cmidrule[lr]{2-4}
\cmidrule[lr]{5-7}
\cmidrule[lr]{8-10}
& Contr. Opr. & Slice Cross. & Comb.
& Contr. Opr. & Slice Cross. & Comb.
& Contr. Opr. & Slice Cross. & Comb. \\
\midrule
11 & 40 & 88 & 85 & 0 & 0 & 0 & 5 & 3 & 8 \\
\midrule[dashed, 0.15pt]
& 56 & 94 & 97 & 0 & 0 & 0 & 4 & 10 & 5 \\
15 & 61 & 99 & 100 & 0 & 7 & 6 & 3 & 6 & 13 \\
& 62 & 100 & 98 & 0 & 23 & 21 & 5 & 8 & 12 \\
\midrule[dashed, 0.15pt]
& 58 & 97 & 100 & 0 & 38 & 37 & 3 & 13 & 14 \\
27 & 65 & 100 & 98 & 2 & 41 & 44 & 4 & 14 & 13 \\
& 69 & 99 & 99 & 6 & 52 & 42 & 7 & 7 & 10 \\
\midrule[dashed, 0.15pt]
39 & 72 & 97 & 99 & 10 & 49 & 57 & 7 & 8 & 8 \\
43 & 74 & 94 & 96 & 7 & 57 & 59 & 3 & 12 & 8 \\
47 & 66 & 94 & 95 & 9 & 49 & 62 & 5 & 11 & 13 \\
51 & 79 & 97 & 94 & 10 & 62 & 61 & 5 & 8 & 9 \\
55 & 80 & 96 & 97 & 11 & 70 & 58 & 5 & 7 & 6 \\
59 & 73 & 96 & 98 & 12 & 59 & 51 & 0 & 7 & 10 \\
63 & 75 & 98 & 95 & 17 & 60 & 68 & 3 & 8 & 7 \\
67 & 74 & 99 & 96 & 21 & 66 & 63 & 4 & 8 & 4 \\
71 & 78 & 98 & 93 & 20 & 59 & 68 & 0 & 3 & 4 \\
75 & 75 & 96 & 96 & 16 & 61 & 72 & 3 & 3 & 9 \\
79 & 78 & 100 & 99 & 16 & 61 & 58 & 1 & 8 & 8 \\
83 & 69 & 96 & 98 & 18 & 74 & 71 & 1 & 5 & 11 \\
87 & 77 & 94 & 98 & 24 & 70 & 56 & 1 & 7 & 9 \\
91 & 72 & 97 & 92 & 20 & 67 & 68 & 4 & 5 & 4 \\
95 & 76 & 97 & 93 & 20 & 52 & 61 & 0 & 7 & 8 \\
99 & 82 & 91 & 95 & 24 & 68 & 63 & 4 & 4 & 2 \\
103 & 77 & 94 & 98 & 25 & 56 & 61 & 1 & 7 & 6 \\
Average
& 70.33 & 96.29 & 96.21 & 12.00 & 50.04 & 50.29 & 3.25 & 7.46 & 8.38 \\
\bottomrule
\end{tblr}
\end{table}
\lipsum[66]
\end{document}
```
| 1 | https://tex.stackexchange.com/users/18189 | 684429 | 317,522 |
https://tex.stackexchange.com/questions/684395 | 1 | With dramatist package to type theater play, how to get first act and first scene show a full-letter number ? And how to make it work only for first acts and scenes, the other acts and scene should remain roman numbers.
As example
```
\documentclass{article}
\usepackage{dramatist}
\begin{document}
\act
Lorem ipsum
\scene
Lorem ipsum
\scene
Lorem ipsum
\act
Lorem ipsum
\scene
Lorem ipsum
\end{document}
```
Should render:
```
Act one
Lorem ipsum
Scene one
Lorem ipsum
Scene II
Lorem ipsum
Act II
Lorem ipsum
Scene one
Lorem ipsum
```
| https://tex.stackexchange.com/users/30933 | “Act one” and “Scene one” in dramatist instead of “Act I” and “Scene I” | true | Change the representation of the counters `act` and `scene`. I also change `\printscenenum` in order it just prints the scene number.
```
\documentclass{article}
\usepackage{dramatist}
\renewcommand{\theact}{%
\ifnum\value{act}=1 one\else\roman{act}\fi
}
\renewcommand{\thescene}{%
\ifnum\value{scene}=1 one\else\roman{scene}\fi
}
\renewcommand{\printscenenum}{\scenenumfont\thescene}
\begin{document}
\act
Lorem ipsum
\scene
Lorem ipsum
\scene
Lorem ipsum
\act
Lorem ipsum
\scene
Lorem ipsum
\end{document}
```
| 2 | https://tex.stackexchange.com/users/4427 | 684430 | 317,523 |
https://tex.stackexchange.com/questions/684425 | 3 |
```
\documentclass{book}
\usepackage{kantlipsum}
\usepackage{appendix}
\usepackage{fontspec} % compile w/XeLaTeX
\setmainfont{Perpetua}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrule}{} % Remove the horizontal line from the header
\fancyfoot[C]{\fontfamily{ppl}\fontsize{11}{13}\selectfont\thepage} % set the footer centred and using Perpetua 11 font
\newcommand{\appendixchapter}{% https://tex.stackexchange.com/a/681868/269662
\cleardoublepage
\fancyfoot[C]{\fontfamily{ppl}\fontsize{11}{13}\selectfont\thepage}
\pagenumbering{arabic}
\setcounter{page}{1}%
\renewcommand{\thepage}{\thechapter\arabic{page}}%
\chapter
}
\begin{document}
\fontsize{13pt}{15.6pt}\selectfont
\chapter{A chapter}
\kant[1]
\appendix
\appendixchapter{An appendix}
\kant
\appendixchapter{Another appendix}
\kant
\end{document}
```
The page numbers are set to Perpetua 11, which compiles like that. However, it only appears to do so on the first page of the (appendix) chapter. Then, the numbers get bigger again. How do I set the page numbering to Perpetua 11 throughout the whole document?
| https://tex.stackexchange.com/users/269662 | How do I set my page numbers to the same size through the whole document? | true | You shouldn't be using `\fontsize{13.5}{15.6}\selectfont`. Instead use `fontsize`.
With `\usepackage[fontsize=13.5pt]{fontsize}`, the baseline skip would be set to `16.19995pt`, so it's easy to fix `\baselinestretch` in order to obtain `15.6pt`: just divide to find that
`15.6/16.19995 = 0.96296593508004654335`
and indeed issuing
```
\linespread{0.96297}
```
produces `\baselineskip=15.6pt`. I'd also set `\topskip` to the font size.
This said, your code has mysterious `\fontfamily{ppl}` instructions that are to be removed.
Now the text height is set to 550pt, but
`(550-13.5)/15.6 = 34.39102564102564102564`
so you don't have an integral number of lines in your pages. You need to reduce a bit the text height:
`13.5+34*15.6 = 543.9`
But roundings accumulate, so it's better to use `543.91pt`.
```
\documentclass{book}
\usepackage[fontsize=13.5pt]{fontsize}
\usepackage{fontspec} % compile w/XeLaTeX
\usepackage{appendix}
\usepackage{kantlipsum}
\usepackage{fancyhdr}
\setmainfont{Perpetua}[
Path=/Applications/Microsoft Word.app/Contents/Resources/DFonts/,
BoldFont=* Bold,
ItalicFont=* Italic,
BoldItalicFont=* Bold Italic,
]
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrulewidth}{0pt} % Remove the horizontal line from the header
\fancyfoot[C]{%
\fontsize{11}{13}\selectfont\thepage
} % set the footer centred and using Perpetua 11 font
% fix also the plain page style
\fancypagestyle{plain}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0pt}%
\fancyfoot[C]{\fontsize{11}{13}\selectfont\thepage}%
}
\newcommand{\appendixchapter}{% https://tex.stackexchange.com/a/681868/269662
\cleardoublepage
\pagenumbering{arabic}%
\renewcommand{\thepage}{\thechapter\arabic{page}}%
\chapter
}
% final setting: fix the baseline skip
\linespread{0.96297}
\setlength{\topskip}{13.5pt}
\setlength{\textheight}{543.91pt}
\begin{document}
\chapter{A chapter}
\kant[1]
\appendix
\appendixchapter{An appendix}
\kant
\appendixchapter{Another appendix}
\kant
\end{document}
```
| 4 | https://tex.stackexchange.com/users/4427 | 684433 | 317,526 |
https://tex.stackexchange.com/questions/684418 | 1 |
```
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{array}
\usepackage{float}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }
\usepackage{enumitem}
\usepackage{nameref}
\usepackage{amsfonts,amsmath,amssymb,amsthm,etoolbox}
\usepackage[version=4]{mhchem}
\usepackage{stmaryrd}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan,}
\urlstyle{same}
\usepackage[vmargin=1.0in, left=1in, right=1.in,
footskip=2.0cm, % footskip margin
]{geometry}
\begin{document}
\begin{table}[]
\caption{}
\label{tab:my-table}
\begin{tabular}{llllllllll}
\multirow{3}{*}{Chrom Length} & \multicolumn{9}{l}{Success Rate (\%)} \\
& \multicolumn{3}{l}{SRP 1} & \multicolumn{3}{l}{SRP 2} & \multicolumn{3}{l}{SRP 3} \\
& Contr. Opr. & Slice Cross. & Comb. & Contr. Opr. & Slice Cross. & Comb. & Contr. Opr. & Slice Cross. & Comb. \\
11 & 40 & 88 & 85 & 0 & 0 & 0 & 5 & 3 & 8 \\
\multirow{3}{*}{15} & 56 & 94 & 97 & 0 & 0 & 0 & 4 & 10 & 5 \\
& 61 & 99 & 100 & 0 & 7 & 6 & 3 & 6 & 13 \\
& 62 & 100 & 98 & 0 & 23 & 21 & 5 & 8 & 12 \\
\multirow{3}{*}{27} & 58 & 97 & 100 & 0 & 38 & 37 & 3 & 13 & 14 \\
& 65 & 100 & 98 & 2 & 41 & 44 & 4 & 14 & 13 \\
& 69 & 99 & 99 & 6 & 52 & 42 & 7 & 7 & 10 \\
39 & 72 & 97 & 99 & 10 & 49 & 57 & 7 & 8 & 8 \\
43 & 74 & 94 & 96 & 7 & 57 & 59 & 3 & 12 & 8 \\
47 & 66 & 94 & 95 & 9 & 49 & 62 & 5 & 11 & 13 \\
51 & 79 & 97 & 94 & 10 & 62 & 61 & 5 & 8 & 9 \\
55 & 80 & 96 & 97 & 11 & 70 & 58 & 5 & 7 & 6 \\
59 & 73 & 96 & 98 & 12 & 59 & 51 & 0 & 7 & 10 \\
63 & 75 & 98 & 95 & 17 & 60 & 68 & 3 & 8 & 7 \\
67 & 74 & 99 & 96 & 21 & 66 & 63 & 4 & 8 & 4 \\
71 & 78 & 98 & 93 & 20 & 59 & 68 & 0 & 3 & 4 \\
75 & 75 & 96 & 96 & 16 & 61 & 72 & 3 & 3 & 9 \\
79 & 78 & 100 & 99 & 16 & 61 & 58 & 1 & 8 & 8 \\
83 & 69 & 96 & 98 & 18 & 74 & 71 & 1 & 5 & 11 \\
87 & 77 & 94 & 98 & 24 & 70 & 56 & 1 & 7 & 9 \\
91 & 72 & 97 & 92 & 20 & 67 & 68 & 4 & 5 & 4 \\
95 & 76 & 97 & 93 & 20 & 52 & 61 & 0 & 7 & 8 \\
99 & 82 & 91 & 95 & 24 & 68 & 63 & 4 & 4 & 2 \\
103 & 77 & 94 & 98 & 25 & 56 & 61 & 1 & 7 & 6 \\
Average & 70.33 & 96.29 & 96.21 & 12.00 & 50.04 & 50.29 & 3.25 & 7.46 & 8.38
\end{tabular}
\end{table}
\end{document}
```
| https://tex.stackexchange.com/users/289569 | How to set the big table within page margins? | false | Here's a solution that employs the machinery of the [tabularx](https://www.ctan.org/pkg/tabularx) package to assure that the table fits within the width of the text block. By using the `X` column type in all ten columns, LaTeX can insert line breaks in cells if and when needed.
Separately, I would also employ the macros of the [booktabs](https://www.ctan.org/pkg/booktabs/) package to provide some additional visual structure, both in the table's header rows and in the body of the table. See, in particular, the use of `\addlinespace` directives in the following code to provide some (hopefully helpful) visual rhythm.
```
\documentclass[11pt,a4paper]{report}
%%\usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage[T1]{fontenc}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{array}
\usepackage{float}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }
\usepackage{enumitem}
\usepackage{nameref}
\usepackage{%amsfonts, % is loaded automatically by 'amssymb'
amsmath,amssymb,amsthm,etoolbox}
\usepackage[version=4]{mhchem}
\usepackage{stmaryrd}
\usepackage{hyperref}
\usepackage{xurl}
\urlstyle{same}
\hypersetup{colorlinks=true, linkcolor=blue,
filecolor=magenta, urlcolor=cyan}
\usepackage[margin=1in, footskip=2cm]{geometry}
%% New code
\usepackage{tabularx,ragged2e,booktabs}
\newcolumntype{L}{>{\RaggedRight}X}
\newcolumntype{C}{>{\Centering}X}
\newcommand\mytab[1]{\smash[b]{%
\begin{tabular}[t]{@{}p{\hsize}@{}} #1 \end{tabular}}}
\begin{document}
\begin{table}[ht]
\caption{A ten-column table\strut}
\label{tab:my-table}
\begin{tabularx}{\textwidth}{@{} L *{9}{C} @{}}
\toprule
\mytab{Chrom Length} & \multicolumn{9}{c@{}}{Success Rate (\%)}\\
\cmidrule(l){2-10}
& \multicolumn{3}{c}{SRP 1}
& \multicolumn{3}{c}{SRP 2}
& \multicolumn{3}{c@{}}{SRP 3} \\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(l){8-10}
& Contr.\ Opr. & Slice Cross. & Comb.
& Contr.\ Opr. & Slice Cross. & Comb.
& Contr.\ Opr. & Slice Cross. & Comb. \\
\midrule
11 & 40 & 88 & 85 & 0 & 0 & 0 & 5 & 3 & 8 \\
\addlinespace
\multirow{3}{*}{15}
& 56 & 94 & 97 & 0 & 0 & 0 & 4 & 10 & 5 \\
& 61 & 99 & 100 & 0 & 7 & 6 & 3 & 6 & 13 \\
& 62 & 100 & 98 & 0 & 23 & 21 & 5 & 8 & 12 \\
\addlinespace
\multirow{3}{*}{27}
& 58 & 97 & 100 & 0 & 38 & 37 & 3 & 13 & 14 \\
& 65 & 100 & 98 & 2 & 41 & 44 & 4 & 14 & 13 \\
& 69 & 99 & 99 & 6 & 52 & 42 & 7 & 7 & 10 \\
\addlinespace
39 & 72 & 97 & 99 & 10 & 49 & 57 & 7 & 8 & 8 \\
43 & 74 & 94 & 96 & 7 & 57 & 59 & 3 & 12 & 8 \\
47 & 66 & 94 & 95 & 9 & 49 & 62 & 5 & 11 & 13 \\
51 & 79 & 97 & 94 & 10 & 62 & 61 & 5 & 8 & 9 \\
55 & 80 & 96 & 97 & 11 & 70 & 58 & 5 & 7 & 6 \\
\addlinespace
59 & 73 & 96 & 98 & 12 & 59 & 51 & 0 & 7 & 10 \\
63 & 75 & 98 & 95 & 17 & 60 & 68 & 3 & 8 & 7 \\
67 & 74 & 99 & 96 & 21 & 66 & 63 & 4 & 8 & 4 \\
71 & 78 & 98 & 93 & 20 & 59 & 68 & 0 & 3 & 4 \\
75 & 75 & 96 & 96 & 16 & 61 & 72 & 3 & 3 & 9 \\
\addlinespace
79 & 78 & 100 & 99 & 16 & 61 & 58 & 1 & 8 & 8 \\
83 & 69 & 96 & 98 & 18 & 74 & 71 & 1 & 5 & 11 \\
87 & 77 & 94 & 98 & 24 & 70 & 56 & 1 & 7 & 9 \\
91 & 72 & 97 & 92 & 20 & 67 & 68 & 4 & 5 & 4 \\
95 & 76 & 97 & 93 & 20 & 52 & 61 & 0 & 7 & 8 \\
\addlinespace
99 & 82 & 91 & 95 & 24 & 68 & 63 & 4 & 4 & 2 \\
103 & 77 & 94 & 98 & 25 & 56 & 61 & 1 & 7 & 6 \\
\midrule
Average & 70.33 & 96.29 & 96.21 & 12.00 & 50.04 & 50.29 & 3.25 & 7.46 & 8.38 \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5001 | 684437 | 317,529 |
https://tex.stackexchange.com/questions/519910 | 2 | I work with LaTeX Workshop in VS Code and have just switched from MikTex to TexLive. But it seems that there is something wrong when I compile with the LaTeX Workshop like this:
The output is as follows:
```
File::Path version 2.08 required--this is only version 1.08 at c:\texlive\2019\texmf-dist\scripts\latexmk\latexmk.pl line 270.
BEGIN failed--compilation aborted at c:\texlive\2019\texmf-dist\scripts\latexmk\latexmk.pl line 270.
C:\texlive\2019\bin\win32\runscript.tlu:911: command failed with exit code 255:
perl.exe c:\texlive\2019\texmf-dist\scripts\latexmk\latexmk.pl -synctex=1 -interaction=nonstopmode -file-line-error -pdf "-outdir=c:/Users/sunha/OneDrive - HKUST Connect/workspace for VS Code/workspace for latex/COMP 2711H Homework 4" "c:/Users/sunha/OneDrive - HKUST Connect/workspace for VS Code/workspace for latex/COMP 2711H Homework 4/hw4"
```
It seems that there's something wrong with the version, however, I can compile without problems with command lines like
```
pdflatex filename.tex
```
So what's the problem? How can I fix it?
| https://tex.stackexchange.com/users/193456 | Error related to latexmk when compiling with LaTeX Workshop | false | In my case VScode persistently tried to use Perl shipped with EIDE extension (which was seriously out of date). Forcing TexLive to use its own version of Perl fixed the problem:
```
tlmgr conf texmf TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL 0
```
| 0 | https://tex.stackexchange.com/users/296094 | 684442 | 317,531 |
https://tex.stackexchange.com/questions/684439 | 1 |
```
@Book{Schouten2001,
abstract = {... De Natuur Als Beeld In Religie, Filosofie En Kunst eerste druk is een boek van M.G.C. Schouten uitgegeven bij Knnv Uitgeverij.
Er is tastbare natuur: de concrete werkelijkheid van aarde, rots, water, planten en dieren, die we kunnen zien, die we kunnen aanraken, van de landschappen waarin we kunnen wandelen. En er is ook ons beeld van de natuur. In onze beleving van de natuur maken we haar tot drager van onze mythen, symbolen en herinneringen, tot spiegel van onze emoties. ... $\backslash$n},
author = {M.G.C. Schouten},
booktitle = {De natuur als beeld in religie, filosofie en kunst},
isbn = {978-90-5011-206-4},
title = {De natuur als beeld in religie, filosofie en kunst},
%publisher = {KNNV Uitgeverij},
url = {http://www.google.com},
%2001
year = {2001}
}
```
| https://tex.stackexchange.com/users/296090 | How to define a \citewithabstract in kaobook to print BibLaTeX "abstract" content in the Bibliography chapter | false | If you put the abstract information in a field called `note`, it will be printed with the citation. For instance:
```
\documentclass{article}
\usepackage{filecontents}
\usepackage[style=apa, backend=biber]{biblatex}
\bibliography{bron.bib}
\addbibresource{bron.bib}
\begin{filecontents*}{bron.bib}
@book{schouten2001,
note = {... De Natuur Als Beeld In Religie, Filosofie En Kunst eerste druk is een boek van M.G.C. Schouten uitgegeven bij Knnv Uitgeverij.
Er is tastbare natuur: de concrete werkelijkheid van aarde, rots, water, planten en dieren, die we kunnen zien, die we kunnen aanraken, van de landschappen waarin we kunnen wandelen. En er is ook ons beeld van de natuur. In onze beleving van de natuur maken we haar tot drager van onze mythen, symbolen en herinneringen, tot spiegel van onze emoties. ... $\backslash$n},
author = {Schouten, M. G. C.},
booktitle = {De natuur als beeld in religie, filosofie en kunst},
isbn = {978-90-5011-206-4},
title = {De natuur als beeld in religie, filosofie en kunst},
%publisher = {KNNV Uitgeverij},
url = {http://www.google.com},
%2001
year = {2001}
}
\end{filecontents*}
\begin{document}
Sentence with \textcite{schouten2001}.
\printbibliography
\end{document}
```
It will work the same for your document class.
| 3 | https://tex.stackexchange.com/users/269662 | 684444 | 317,532 |
https://tex.stackexchange.com/questions/684386 | 1 | After getting to the solution with `longtable` I was finding I needed `longtabu` because I want to use `X` columns.
However, using `longtabu` the sum does break and shows double to correct value.
And when using a `X`column it adds even more to it.
Is that because the table is compiled multiple times and therefore also running the adding part multiple times? Is there another way to solve this with `expl3` or do I just need to use `longtable` and then manually calculate the `X` column instead to make the table fill the whole `textwidth`?
```
\documentclass[parskip=full]{scrlttr2}
\renewcommand\familydefault{\sfdefault}
\usepackage[defaultsans, scale=0.9]{opensans}
\usepackage[check-declarations]{expl3}
\ExplSyntaxOn
\NewDocumentCommand{\newtime}{m}
{
\fp_new:c { g_timecalc_time_#1_fp }
}
\newtime{default} % initialize one
\NewDocumentCommand{\resettime}{O{default}}{
\fp_gset:cn { g_timecalc_time_#1_fp } { \fpeval{0} }
}
% \addtime* will also show the added time
\NewDocumentCommand{\addtime}{sO{default}mm}
{
\timecalc_time_add:nnn { #2 } { #3 } { #4 }
% with \addtime* also show what's been added
\IfBooleanT{#1}{#3\,\textup{#4}}
}
\NewDocumentCommand{\strtime}{O{default}m}
{
\timecalc_time_str:nn { #1 } { #2 }
}
\int_new:N \l__timecalc_time_days_int
\int_new:N \l__timecalc_time_hours_int
\int_new:N \l__timecalc_time_minutes_int
\cs_new_protected:Nn \timecalc_time_add:nnn
{
\str_case:nnF { #3 }
{
{h}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 * 60 } }
{d}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 * 60 * 24 } }
{min}{ \fp_gadd:cn { g_timecalc_time_#1_fp } { #2 } }
}
{\ERROR}
}
\cs_new_protected:Nn \int_div_mod:nnn {
\int_set:Nn #3
{ \int_div_truncate:nn { #1 } { #2 } }
\int_set:Nn #1
{ \int_mod:nn { #1 } { #2 } }
}
\cs_new_protected:Nn \timecalc_time_str:nn
{
% round to an integral number of minutes
\int_set:Nn \l__timecalc_time_minutes_int
{ \fp_eval:n { round( \fp_use:c { g_timecalc_time_#1_fp }, 0 ) } }
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{d}
}
{%yes
% compute and remove the number of days
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{1440}{\l__timecalc_time_days_int}
% now print the days
\int_compare:nTF { \l__timecalc_time_days_int > 0 }
{ \int_eval:n { \l__timecalc_time_days_int }\,\textup{d}\; }
{% no days
\unkern
}
}{} % no
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{h} ||
\str_if_eq_p:nn{#2}{d}
}
{%yes
% compute and remove the number of hours
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{60}{\l__timecalc_time_hours_int}
% now print the hours
\int_compare:nTF { \l__timecalc_time_hours_int > 0 }
{
\int_eval:n { \l__timecalc_time_hours_int }\,\textup{h}\;
}
{% no hours
\unkern
}
}{} % no
% now print the minutes
\int_compare:nTF { \l__timecalc_time_minutes_int > 0 }
{
\int_eval:n { \l__timecalc_time_minutes_int }\,\textup{min}
}
{% no minutes
0\,min%\unkern
}
}
\ExplSyntaxOff
\usepackage{longtable}[=v4.13]
\usepackage{tabu}%
\begin{document}
\begin{longtable}{r}
\textbf{time}
\endhead
\addtime*{30}{min}\\
\addtime*{4}{h} \\
\end{longtable}
This leads to a complete time of \strtime{h}.
\resettime
Current time: \strtime{h}.
\begin{longtabu}{r}%
\textbf{time}
\endhead
\addtime*{30}{min}\\
\addtime*{4}{h} \\
\end{longtabu}%
This leads to a complete time of \strtime{h}.
\resettime
Current time: \strtime{h}.
\begin{longtabu}{X}%
\textbf{time}
\endhead
\addtime*{30}{min}\\
\addtime*{4}{h} \\
\end{longtabu}%
This leads to a complete time of \strtime{h}.
\end{document}
```
| https://tex.stackexchange.com/users/281557 | Summing does not work in longtabu | false | to answer the question in the comments: `longtable` stores the width of columns for every table in the aux file in a command (which uses a roman number):
```
\gdef \LT@i {\LT@entry
{1}{17.00003pt}\LT@entry
{1}{27.27783pt}\LT@entry
{1}{32.55562pt}\LT@entry
{1}{50.88902pt}}
\gdef \LT@ii {\LT@entry
{1}{59.45284pt}\LT@entry
{1}{91.35826pt}\LT@entry
{1}{80.13902pt}}
```
You can retrieve the columns size by processing this command, e.g. before the longtable. It is up to you what you do with the info. Here I only show it and draw rules (be aware that info is only there at the second compilation, so you need some test and fall back for the first).
```
\documentclass{article}
\usepackage{longtable,tikz}
\makeatletter
\ExplSyntaxOn
\newcommand\shownextlongtablewidth
{
\group_begin:
\int_zero:N\l_tmpa_int
\tl_if_exist:cT {LT@\int_to_roman:n{\c@LT@tables+1}}
{
\par\centering % to center the rules like the longtable
\cs_set:Npn \LT@entry##1##2
{
\int_incr:N\l_tmpa_int
\typeout{Width~of~column~\int_use:N\l_tmpa_int\c_space_tl~
in~table~\int_eval:n{\c@LT@tables+1}~is~##2}
\tikz{\draw[red,<->](0,0)--++(##2,0)}
}
\tl_use:c{LT@\int_to_roman:n{\c@LT@tables+1}}%
\par
}
\group_end:
}
\makeatother
\ExplSyntaxOff
\begin{document}
\shownextlongtablewidth
\begin{longtable}{lcl|l}
a&abc & duck & blubblub
\end{longtable}
\shownextlongtablewidth
\begin{longtable}{l@{\hspace{1cm}}p{3cm}l}
12345&abc & some long word \\
b & xxxxxxx &123
\end{longtable}
\end{document}
```
The log-file will then say
```
Width of column 1 in table 1 is 17.00003pt
Width of column 2 in table 1 is 27.27783pt
Width of column 3 in table 1 is 32.55562pt
Width of column 4 in table 1 is 50.88902pt
Width of column 1 in table 2 is 59.45284pt
Width of column 2 in table 2 is 91.35826pt
Width of column 3 in table 2 is 80.13902pt
```
| 2 | https://tex.stackexchange.com/users/2388 | 684446 | 317,533 |
https://tex.stackexchange.com/questions/684445 | 2 | I have two tables and text. I would like to have the text start on a new page:
```
\documentclass{article}
\begin{document}
\begin{table}[!ht]
\centering
\caption{Decomposition Level 6}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\textbf{Channel} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & N & N \\ \hline
\textbf{F7} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F9} & N & N & N & N & Ab & Ab & N & N & Ab & N \\ \hline
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Pz} & N & N & N & N & N & Ab & N & Ab & N & N \\ \hline
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T6} & N & N & N & N & Ab & Ab & N & Ab & N & Ab \\ \hline
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc6} & N & N & N & Ab & Ab & N & N & N & N & N \\ \hline
\textbf{Cp2} & N & N & N & N & Ab & Ab & Ab & Ab & N & Ab \\ \hline
\textbf{Cp6} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F10} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{EKG EKG} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{FP2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\end{tabular}
\end{table}
\begin{table}[!ht]
\centering
\caption{Decomposition Level 7}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\textbf{Channel} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C3} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & Ab & N \\ \hline
\textbf{F7} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{T3} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{Cp5} & N & N & N & Ab & Ab & N & N & N & N & N \\ \hline
\textbf{F9} & N & N & N & N & Ab & N & N & N & Ab & N \\ \hline
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Pz} & N & N & N & N & N & N & N & Ab & N & N \\ \hline
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P4} & N & N & N & Ab & Ab & N & N & N & N & Ab \\ \hline
\textbf{O2} & N & N & N & Ab & Ab & Ab & N & Ab & N & Ab \\ \hline
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T4} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{T6} & N & N & N & N & N & N & N & Ab & N & Ab \\ \hline
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc6} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{Cp2} & N & N & N & N & N & Ab & N & Ab & N & N \\ \hline
\textbf{Cp6} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{F10} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{EKG EKG} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{FP2} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\end{tabular}
\end{table}
\newpage
From those two tables, it can be concluded that the seizure (mostly) happened at the 5th minute within the timeline.
Previously it has been mentioned that the extracted recording was taken from 7:10-7:20AM data, so the 5th minute in the timeline refers to around 7:14-7:15AM.
Finally, it can be concluded that it matched with the data provided in the text file \verb|Seizures-list-PN03.txt|.
\end{document}
```
When I run this code, the text will be written below the table. How can I force it to be be written in the following blank page? Seems the command `\newpage` doesn't work here.
| https://tex.stackexchange.com/users/295683 | Force text onto new page | true | Use `\clearpage` instead of `\newpage`. Here there is the solution.
```
\documentclass{article}
\begin{document}
\begin{table}[!ht]
\centering
\caption{Decomposition Level 6}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\textbf{Channel} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & N & N \\ \hline
\textbf{F7} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F9} & N & N & N & N & Ab & Ab & N & N & Ab & N \\ \hline
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Pz} & N & N & N & N & N & Ab & N & Ab & N & N \\ \hline
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T6} & N & N & N & N & Ab & Ab & N & Ab & N & Ab \\ \hline
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc6} & N & N & N & Ab & Ab & N & N & N & N & N \\ \hline
\textbf{Cp2} & N & N & N & N & Ab & Ab & Ab & Ab & N & Ab \\ \hline
\textbf{Cp6} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F10} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{EKG EKG} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{FP2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\end{tabular}
\end{table}
\begin{table}[!ht]
\centering
\caption{Decomposition Level 7}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\textbf{Channel} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C3} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & Ab & N \\ \hline
\textbf{F7} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{T3} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{Cp5} & N & N & N & Ab & Ab & N & N & N & N & N \\ \hline
\textbf{F9} & N & N & N & N & Ab & N & N & N & Ab & N \\ \hline
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Pz} & N & N & N & N & N & N & N & Ab & N & N \\ \hline
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P4} & N & N & N & Ab & Ab & N & N & N & N & Ab \\ \hline
\textbf{O2} & N & N & N & Ab & Ab & Ab & N & Ab & N & Ab \\ \hline
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T4} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{T6} & N & N & N & N & N & N & N & Ab & N & Ab \\ \hline
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc6} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{Cp2} & N & N & N & N & N & Ab & N & Ab & N & N \\ \hline
\textbf{Cp6} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{F10} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{EKG EKG} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{FP2} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\end{tabular}
\end{table}
\clearpage
From those two tables, it can be concluded that the seizure (mostly) happened at the 5th minute within the timeline.
Previously it has been mentioned that the extracted recording was taken from 7:10-7:20AM data, so the 5th minute in the timeline refers to around 7:14-7:15AM.
Finally, it can be concluded that it matched with the data provided in the text file \verb|Seizures-list-PN03.txt|.
\end{document}
```
| 6 | https://tex.stackexchange.com/users/117876 | 684447 | 317,534 |
https://tex.stackexchange.com/questions/684445 | 2 | I have two tables and text. I would like to have the text start on a new page:
```
\documentclass{article}
\begin{document}
\begin{table}[!ht]
\centering
\caption{Decomposition Level 6}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\textbf{Channel} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & N & N \\ \hline
\textbf{F7} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F9} & N & N & N & N & Ab & Ab & N & N & Ab & N \\ \hline
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Pz} & N & N & N & N & N & Ab & N & Ab & N & N \\ \hline
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T6} & N & N & N & N & Ab & Ab & N & Ab & N & Ab \\ \hline
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc6} & N & N & N & Ab & Ab & N & N & N & N & N \\ \hline
\textbf{Cp2} & N & N & N & N & Ab & Ab & Ab & Ab & N & Ab \\ \hline
\textbf{Cp6} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{F10} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{EKG EKG} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{FP2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\end{tabular}
\end{table}
\begin{table}[!ht]
\centering
\caption{Decomposition Level 7}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\textbf{Channel} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C3} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & Ab & N \\ \hline
\textbf{F7} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{T3} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & Ab \\ \hline
\textbf{Cp5} & N & N & N & Ab & Ab & N & N & N & N & N \\ \hline
\textbf{F9} & N & N & N & N & Ab & N & N & N & Ab & N \\ \hline
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Pz} & N & N & N & N & N & N & N & Ab & N & N \\ \hline
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{P4} & N & N & N & Ab & Ab & N & N & N & N & Ab \\ \hline
\textbf{O2} & N & N & N & Ab & Ab & Ab & N & Ab & N & Ab \\ \hline
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{T4} & N & N & N & Ab & Ab & Ab & N & N & N & N \\ \hline
\textbf{T6} & N & N & N & N & N & N & N & Ab & N & Ab \\ \hline
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\ \hline
\textbf{Fc6} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{Cp2} & N & N & N & N & N & Ab & N & Ab & N & N \\ \hline
\textbf{Cp6} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{F10} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{EKG EKG} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\ \hline
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\ \hline
\textbf{FP2} & N & N & N & N & Ab & Ab & N & N & N & N \\ \hline
\end{tabular}
\end{table}
\newpage
From those two tables, it can be concluded that the seizure (mostly) happened at the 5th minute within the timeline.
Previously it has been mentioned that the extracted recording was taken from 7:10-7:20AM data, so the 5th minute in the timeline refers to around 7:14-7:15AM.
Finally, it can be concluded that it matched with the data provided in the text file \verb|Seizures-list-PN03.txt|.
\end{document}
```
When I run this code, the text will be written below the table. How can I force it to be be written in the following blank page? Seems the command `\newpage` doesn't work here.
| https://tex.stackexchange.com/users/295683 | Force text onto new page | false | Your readers *won't* understand what “those tables” refers to.
Call them by reference and just leave them to float with the `[p]` option.
```
\documentclass{article}
\usepackage{booktabs}
\usepackage{lipsum}
\begin{document}
\lipsum[1-5]
\begin{table}[p]
\centering
\caption{Decomposition Level 6}
\label{tab:dl6}
\begin{tabular}{@{} l *{10}{c} @{}}
\toprule
\textbf{Channel} &
\textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} &
\textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} &
\textbf{9} & \textbf{10} \\
\midrule
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{C3} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & N & N \\
\textbf{F7} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{T3} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Cp5} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{F9} & N & N & N & N & Ab & Ab & N & N & Ab & N \\
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Pz} & N & N & N & N & N & Ab & N & Ab & N & N \\
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{P4} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{O2} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{T4} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{T6} & N & N & N & N & Ab & Ab & N & Ab & N & Ab \\
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Fc6} & N & N & N & Ab & Ab & N & N & N & N & N \\
\textbf{Cp2} & N & N & N & N & Ab & Ab & Ab & Ab & N & Ab \\
\textbf{Cp6} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{F10} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{EKG EKG} & N & N & N & N & Ab & Ab & N & N & N & N \\
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\
\textbf{FP2} & N & N & N & N & Ab & N & N & N & N & N \\
\bottomrule
\end{tabular}
\end{table}
\begin{table}[p]
\centering
\caption{Decomposition Level 7}
\label{tab:dl7}
\begin{tabular}{@{} l *{10}{c} @{}}
\toprule
\textbf{Channel} & \textbf{1} & \textbf{2} & \textbf{3} &
\textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} &
\textbf{8} & \textbf{9} & \textbf{10} \\
\textbf{Fp1} & N & N & N & N & Ab & N & N & N & N & Ab \\
\textbf{F3} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{C3} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\
\textbf{P3} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{O1} & N & N & N & Ab & Ab & N & N & Ab & Ab & N \\
\textbf{F7} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\
\textbf{T3} & N & N & N & N & Ab & Ab & N & Ab & N & N \\
\textbf{T5} & N & N & N & Ab & Ab & Ab & N & N & N & N \\
\textbf{Fc1} & N & N & N & N & Ab & N & N & N & N & Ab \\
\textbf{Fc5} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Cp1} & N & N & N & N & Ab & N & N & N & N & Ab \\
\textbf{Cp5} & N & N & N & Ab & Ab & N & N & N & N & N \\
\textbf{F9} & N & N & N & N & Ab & N & N & N & Ab & N \\
\textbf{Fz} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Cz} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Pz} & N & N & N & N & N & N & N & Ab & N & N \\
\textbf{F4} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{C4} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{P4} & N & N & N & Ab & Ab & N & N & N & N & Ab \\
\textbf{O2} & N & N & N & Ab & Ab & Ab & N & Ab & N & Ab \\
\textbf{F8} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{T4} & N & N & N & Ab & Ab & Ab & N & N & N & N \\
\textbf{T6} & N & N & N & N & N & N & N & Ab & N & Ab \\
\textbf{Fc2} & N & N & N & N & Ab & N & N & N & N & N \\
\textbf{Fc6} & N & N & N & N & Ab & Ab & N & N & N & N \\
\textbf{Cp2} & N & N & N & N & N & Ab & N & Ab & N & N \\
\textbf{Cp6} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\
\textbf{F10} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\
\textbf{EKG EKG} & N & N & N & Ab & Ab & Ab & N & N & N & Ab \\
\textbf{EKG 1} & N & N & N & N & Ab & Ab & N & N & N & N \\
\textbf{EKG 2} & N & N & N & N & Ab & Ab & N & Ab & N & N \\
\textbf{FP2} & N & N & N & N & Ab & Ab & N & N & N & N \\
\end{tabular}
\end{table}
From tables~\ref{tab:dl6} and~\ref{tab:dl7} it can be concluded
that the seizure (mostly) happened at the 5th minute within the
timeline. Previously it has been mentioned that the extracted
recording was taken from 7:10--7:20AM data, so the 5th minute in
the timeline refers to around 7:14--7:15AM. Finally, it can be
concluded that it matched with the data provided in the text
file \texttt{Seizures-list-PN03.txt}.
\lipsum
\end{document}
```
| 4 | https://tex.stackexchange.com/users/4427 | 684455 | 317,538 |
https://tex.stackexchange.com/questions/684405 | 1 | I have a set of lecture notes and each lecture is contained within a subfile, and the main file contains a list of all the lectures like so:
```
\subfile{lec-1}
\subfile{lec-2}
% more files labeled lec-X
\subfile{lec-26}
```
Every time I need to set the view to certain lectures/the full document I would need to comment/uncomment manually, and I would like something that is a bit less tedious.
Are there any better ways to organize this? Perhaps a simple foreach loop would work, but are there any more elegant solutions? Thanks!
| https://tex.stackexchange.com/users/249246 | Better way to subfile multiple files with similar titles? | false | With `parts.sty` as given below, you can specify in the beginning, which parts to include, like so:
```
\documentclass{article}
\usepackage{parts}
\onlyParts{basic}
%\onlyParts{basic,advanced}% typeset all
\begin{document}
\Part{basic}{\subfile{lec-1}}
\Part{advanced}{\subfile{lec-2}}
\Part{basic}{\subfile{lec-3}}
\Part{advanced}{\subfile{lec-4}}
\end{document}
```
If you want to specify the included material by the number of the lecture, you can do it more succinctly with a custom command `\myPart`:
```
\documentclass{article}
\usepackage{parts}
\newcommand\myPart[#1]{\Part{#1}{\subfile{lec-#1}}}
\onlyParts{2,4}
\begin{document}
\myPart{1}
\myPart{2}
\myPart{3}
\myPart{4}
\end{document}
```
Here is the code of `parts.sty`.
```
\newcommand\onlyParts[1]{\def\parts@only{#1}}
\onlyParts{}
\newcommand\Part[2]{%
\def\parts@this{#1}%
\@for\parts@that:=\parts@only\do{%
\ifx\parts@this\parts@that
#2%
\fi
}%
\ignorespaces
}
```
This utility is not restricted to loading subfiles, but you can use it with text and other code as well.
```
\documentclass{article}
\usepackage{parts}
\onlyParts{Monday,Wednesday}
\begin{document}
\Part{Monday}{On Mondays, we recover from the weekend. }
\Part{Tuesday}{On Tuesdays, we work from nine to five. }
\Part{Wednesday}{On Wednesdays, we prepare for the rest of the week. }
\Part{Monday}{On a second thought, we should also get something done on Mondays. }
\end{document}
```
| 0 | https://tex.stackexchange.com/users/110998 | 684463 | 317,540 |
https://tex.stackexchange.com/questions/684468 | 1 | I have checked for duplicates to this question, but since the output from the solutions has changed for some, and my problem is not solved, I am asking again.
My problem is that as far as I have understood the APA style guide, the first citation should include up to 6 authors, but the second time this citation is called, it should only insert firstAuthor et al. instead of up to all six.
Why is the default behavior of biblatex-apa to not do this? Below is a workable example that shows that the output already starts with the et al.
```
\documentclass[english,11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@book{allemang.etal_2020,
title = {Semantic {{Web}} for the {{Working Ontologist}}: {{Effective Modeling}} for {{Linked Data}}, {{RDFS}}, and {{OWL}}},
shorttitle = {Semantic {{Web}} for the {{Working Ontologist}}},
author = {Allemang, Dean and Hendler, Jim and Gandon, Fabien},
date = {2020},
edition = {3},
volume = {33},
publisher = {{Association for Computing Machinery}},
location = {{New York, NY, USA}},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\parencite{allemang.etal_2020}
\parencite{allemang.etal_2020}
\textcite{allemang.etal_2020}
\end{document}
```
Output:
```
(Allemang et al., 2020)
(Allemang et al., 2020)
Allemang et al. (2020)
```
When adding a `maxcitenames=6` option we get the following which now shows all three authors in the first citation but does not abbreviate it to et al. in the second.
Output:
```
(Allemang, Hendler, & Gandon, 2020)
(Allemang, Hendler, & Gandon, 2020)
Allemang, Hendler, and Gandon (2020)
```
I am especially confused because [Basically the same question](https://tex.stackexchange.com/questions/248683/in-text-citation-with-biblatex-apa-not-using-et-al-correctly-two-authors-liste?newreg=4020c5c925104f36b60b9f4224a4c062) was asked back in 2015, and it apparently worked back then, according to the most upvoted answer. I know that they also included `uniquelist=true`, but that has not changed anything in my testing.
Please help me, as I am going insane...
| https://tex.stackexchange.com/users/296107 | biblatex-apa not using et al. correctly for in-text citations | true | The behaviour of having up to six names on first citations and up to three + "et al." on subsequent citations is APA style according to the 6th edition of the APA manual. The guidance in the current 7th edition, however, is different (cf. <https://apastyle.apa.org/style-grammar-guidelines/citations/basic-principles/author-date>). In 7th-edition APA style lists with three or more authors are always abbreviated to "`<first author>` + et al.". (There are exceptions in case the first authors are the same, but subsequent authors differ, but that is not relevant here.)
Current versions of [`biblatex-apa`](https://ctan.org/pkg/biblatex-apa) implement 7th-edition APA style and hence do not (generally) show more than two names on first citations. If you want 6th-edition APA style, use [`biblatex-apa6`](https://ctan.org/pkg/biblatex-apa6)'s `style=apa6,` instead of `style=apa,`.
| 1 | https://tex.stackexchange.com/users/35864 | 684472 | 317,542 |
https://tex.stackexchange.com/questions/684466 | 5 | This is a follow-up to my previous question [How to convert a sequence of integers into a monomial](https://tex.stackexchange.com/questions/684352/how-to-convert-a-sequence-of-integers-into-a-monomial/684373?noredirect=1#comment1698091_684373)
**Question 1.** Is it possible a macro that takes two inputs
* varname: `{ x1, x2, ... , xn }`
* exp: `{ e1, e2, ... , en }`
and generate the `TeX` output
`x1^{e1} \cdots xn^{en}`
Example:
* varname = `{ a, B, \gamma, \Delta }`
* exp = `{ -3, 0, 1, 4 }`
would give
`a^{-3} B^0 \gamma^1 \Delta^4`
*Note: the two input lists have the same positive length, but this length can change from one instance to another.*
**Question 2.** The same basic macro as above, with the following additional features.
* If one of the `ei` is `1`, print `xi` instead of `xi^1`.
* Do not print any term whose exponent is zero.
So in the example about, this time we want
`a^{-3} \gamma \Delta^4`
*Note: Question 2 **does not replace** Question 1; there are instances where I need to display every term of the monomial, including ones with exponents 0 or 1.*
| https://tex.stackexchange.com/users/183182 | Macro for printing monomials | true | You can use `\seq_mapthread_function:nn`
The command `\monomial` takes the variables and the exponents; it traverses the two lists (stopping when one of them ends) and does the job for every pair of items.
The \*-variant makes every variable and exponent to be printed.
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\monomial}{smm}
{
\underflow_monomial:nnn { #1 } { #2 } { #3 }
}
\seq_new:N \l__underflow_monomial_var_seq
\seq_new:N \l__underflow_monomial_exp_seq
\bool_new:N \l__underflow_monomial_show_bool
\cs_new_protected:Nn \underflow_monomial:nnn
{
\group_begin:
\bool_set:Nn \l__underflow_monomial_show_bool { #1 }
\seq_set_from_clist:Nn \l__underflow_monomial_var_seq { #2 }
\seq_set_from_clist:Nn \l__underflow_monomial_exp_seq { #3 }
\seq_mapthread_function:NNN
\l__underflow_monomial_var_seq % first seq
\l__underflow_monomial_exp_seq % second seq
\__underflow_monomial_print:nn
\group_end:
}
\cs_new_protected:Nn \__underflow_monomial_print:nn
{
\str_case:nnF { #2 }
{
{0}{\bool_if:NT \l__underflow_monomial_show_bool { #1^{0} }}
{1}{#1\bool_if:NT \l__underflow_monomial_show_bool { ^{1} }}
}
{ #1^{#2} }
}
\ExplSyntaxOff
\begin{document}
$\monomial{ a, B, \gamma, \Delta }{ -3, 0, 1, 4 }$
$\monomial*{ a, B, \gamma, \Delta }{ -3, 0, 1, 4 }$
\end{document}
```
The corner case when every exponent is zero is not considered (you get nothing in this case).
With
```
$\monomial{x_1,x_2,x_3}{e_1,e_2,e_3}$
```
you get
| 3 | https://tex.stackexchange.com/users/4427 | 684475 | 317,544 |
https://tex.stackexchange.com/questions/684466 | 5 | This is a follow-up to my previous question [How to convert a sequence of integers into a monomial](https://tex.stackexchange.com/questions/684352/how-to-convert-a-sequence-of-integers-into-a-monomial/684373?noredirect=1#comment1698091_684373)
**Question 1.** Is it possible a macro that takes two inputs
* varname: `{ x1, x2, ... , xn }`
* exp: `{ e1, e2, ... , en }`
and generate the `TeX` output
`x1^{e1} \cdots xn^{en}`
Example:
* varname = `{ a, B, \gamma, \Delta }`
* exp = `{ -3, 0, 1, 4 }`
would give
`a^{-3} B^0 \gamma^1 \Delta^4`
*Note: the two input lists have the same positive length, but this length can change from one instance to another.*
**Question 2.** The same basic macro as above, with the following additional features.
* If one of the `ei` is `1`, print `xi` instead of `xi^1`.
* Do not print any term whose exponent is zero.
So in the example about, this time we want
`a^{-3} \gamma \Delta^4`
*Note: Question 2 **does not replace** Question 1; there are instances where I need to display every term of the monomial, including ones with exponents 0 or 1.*
| https://tex.stackexchange.com/users/183182 | Macro for printing monomials | false | What can we do with TeX primitives only:
```
\def\afterfi#1#2\fi{\fi#1}
\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\def\monomial#1#2{\def\mnL{}\mnA #1,\end #2,\end}
\def\mnA #1,#2\end #3,#4\end{\addto\mnL{\mnB{#1}{#3}}%
\ifx^#2^\mnL \else \afterfi{\mnA #2\end#4\end}\fi
}
\def\mnB#1#2{\ifcase#2\or #1\else #1^{#2}\fi}
$\monomial{ a, B, \gamma, \Delta }{ -3, 0, 1, 4 }$
```
If you want to print all exponents, define:
```
\def\mnB#1#2{#1^{#2}}
```
| 4 | https://tex.stackexchange.com/users/51799 | 684478 | 317,545 |
https://tex.stackexchange.com/questions/684418 | 1 |
```
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{array}
\usepackage{float}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }
\usepackage{enumitem}
\usepackage{nameref}
\usepackage{amsfonts,amsmath,amssymb,amsthm,etoolbox}
\usepackage[version=4]{mhchem}
\usepackage{stmaryrd}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan,}
\urlstyle{same}
\usepackage[vmargin=1.0in, left=1in, right=1.in,
footskip=2.0cm, % footskip margin
]{geometry}
\begin{document}
\begin{table}[]
\caption{}
\label{tab:my-table}
\begin{tabular}{llllllllll}
\multirow{3}{*}{Chrom Length} & \multicolumn{9}{l}{Success Rate (\%)} \\
& \multicolumn{3}{l}{SRP 1} & \multicolumn{3}{l}{SRP 2} & \multicolumn{3}{l}{SRP 3} \\
& Contr. Opr. & Slice Cross. & Comb. & Contr. Opr. & Slice Cross. & Comb. & Contr. Opr. & Slice Cross. & Comb. \\
11 & 40 & 88 & 85 & 0 & 0 & 0 & 5 & 3 & 8 \\
\multirow{3}{*}{15} & 56 & 94 & 97 & 0 & 0 & 0 & 4 & 10 & 5 \\
& 61 & 99 & 100 & 0 & 7 & 6 & 3 & 6 & 13 \\
& 62 & 100 & 98 & 0 & 23 & 21 & 5 & 8 & 12 \\
\multirow{3}{*}{27} & 58 & 97 & 100 & 0 & 38 & 37 & 3 & 13 & 14 \\
& 65 & 100 & 98 & 2 & 41 & 44 & 4 & 14 & 13 \\
& 69 & 99 & 99 & 6 & 52 & 42 & 7 & 7 & 10 \\
39 & 72 & 97 & 99 & 10 & 49 & 57 & 7 & 8 & 8 \\
43 & 74 & 94 & 96 & 7 & 57 & 59 & 3 & 12 & 8 \\
47 & 66 & 94 & 95 & 9 & 49 & 62 & 5 & 11 & 13 \\
51 & 79 & 97 & 94 & 10 & 62 & 61 & 5 & 8 & 9 \\
55 & 80 & 96 & 97 & 11 & 70 & 58 & 5 & 7 & 6 \\
59 & 73 & 96 & 98 & 12 & 59 & 51 & 0 & 7 & 10 \\
63 & 75 & 98 & 95 & 17 & 60 & 68 & 3 & 8 & 7 \\
67 & 74 & 99 & 96 & 21 & 66 & 63 & 4 & 8 & 4 \\
71 & 78 & 98 & 93 & 20 & 59 & 68 & 0 & 3 & 4 \\
75 & 75 & 96 & 96 & 16 & 61 & 72 & 3 & 3 & 9 \\
79 & 78 & 100 & 99 & 16 & 61 & 58 & 1 & 8 & 8 \\
83 & 69 & 96 & 98 & 18 & 74 & 71 & 1 & 5 & 11 \\
87 & 77 & 94 & 98 & 24 & 70 & 56 & 1 & 7 & 9 \\
91 & 72 & 97 & 92 & 20 & 67 & 68 & 4 & 5 & 4 \\
95 & 76 & 97 & 93 & 20 & 52 & 61 & 0 & 7 & 8 \\
99 & 82 & 91 & 95 & 24 & 68 & 63 & 4 & 4 & 2 \\
103 & 77 & 94 & 98 & 25 & 56 & 61 & 1 & 7 & 6 \\
Average & 70.33 & 96.29 & 96.21 & 12.00 & 50.04 & 50.29 & 3.25 & 7.46 & 8.38
\end{tabular}
\end{table}
\end{document}
```
| https://tex.stackexchange.com/users/289569 | How to set the big table within page margins? | false | I'd not use `\multirow` for the 15 and 27 groups: the output would be very ambiguous. An empty cell after one in the first column will be interpreted as “repeat the previous value”.
I'd also use `siunitx`, besides `booktabs`, in order to improve the appearance. The `\splitcell` command helps in setting complex cells; the `*`-variant also applies `\smash`.
Provide a caption text: your readers will appreciate.
```
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
vmargin=1.0in,
left=1in,
right=1.in,
footskip=2.0cm, % footskip margin
]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{graphicx}
\usepackage{array}
\usepackage[export]{adjustbox}
\usepackage{enumitem}
\usepackage{nameref}
\usepackage{caption}
\usepackage{amsfonts,amsmath,amssymb,amsthm,etoolbox}
\usepackage[version=4]{mhchem}
\usepackage{stmaryrd}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan,}
\urlstyle{same}
\graphicspath{ {./images/} }
\NewDocumentCommand{\splitcell}{sm}{%
\IfBooleanT{#1}{\smash}{\begin{tabular}[t]{@{}c@{}}#2\end{tabular}}%
}
\begin{document}
\begin{table}[htp]
\caption{A caption here, please}
\label{tab:my-table}
\begin{tabular}{
@{}
S[table-format=3.0]
S[table-format=2.0]
S[table-format=3.0]
S[table-format=3.0]
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.0]
@{}
}
\toprule
\splitcell*{Chrom \\ Length} & \multicolumn{9}{c}{Success Rate (\%)} \\
\cmidrule(l){2-10}
& \multicolumn{3}{c}{SRP 1} & \multicolumn{3}{c}{SRP 2} & \multicolumn{3}{c}{SRP 3} \\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(l){8-10}
& \splitcell{Contr. \\ Opr.} & \splitcell{Slice \\ Cross.} & {Comb.}
& \splitcell{Contr. \\ Opr.} & \splitcell{Slice \\ Cross.} & {Comb.}
& \splitcell{Contr. \\ Opr.} & \splitcell{Slice \\ Cross.} & {Comb.} \\
\midrule
11 & 40 & 88 & 85 & 0 & 0 & 0 & 5 & 3 & 8 \\
15 & 56 & 94 & 97 & 0 & 0 & 0 & 4 & 10 & 5 \\
& 61 & 99 & 100 & 0 & 7 & 6 & 3 & 6 & 13 \\
& 62 & 100 & 98 & 0 & 23 & 21 & 5 & 8 & 12 \\
27 & 58 & 97 & 100 & 0 & 38 & 37 & 3 & 13 & 14 \\
& 65 & 100 & 98 & 2 & 41 & 44 & 4 & 14 & 13 \\
& 69 & 99 & 99 & 6 & 52 & 42 & 7 & 7 & 10 \\
39 & 72 & 97 & 99 & 10 & 49 & 57 & 7 & 8 & 8 \\
43 & 74 & 94 & 96 & 7 & 57 & 59 & 3 & 12 & 8 \\
47 & 66 & 94 & 95 & 9 & 49 & 62 & 5 & 11 & 13 \\
51 & 79 & 97 & 94 & 10 & 62 & 61 & 5 & 8 & 9 \\
55 & 80 & 96 & 97 & 11 & 70 & 58 & 5 & 7 & 6 \\
59 & 73 & 96 & 98 & 12 & 59 & 51 & 0 & 7 & 10 \\
63 & 75 & 98 & 95 & 17 & 60 & 68 & 3 & 8 & 7 \\
67 & 74 & 99 & 96 & 21 & 66 & 63 & 4 & 8 & 4 \\
71 & 78 & 98 & 93 & 20 & 59 & 68 & 0 & 3 & 4 \\
75 & 75 & 96 & 96 & 16 & 61 & 72 & 3 & 3 & 9 \\
79 & 78 & 100 & 99 & 16 & 61 & 58 & 1 & 8 & 8 \\
83 & 69 & 96 & 98 & 18 & 74 & 71 & 1 & 5 & 11 \\
87 & 77 & 94 & 98 & 24 & 70 & 56 & 1 & 7 & 9 \\
91 & 72 & 97 & 92 & 20 & 67 & 68 & 4 & 5 & 4 \\
95 & 76 & 97 & 93 & 20 & 52 & 61 & 0 & 7 & 8 \\
99 & 82 & 91 & 95 & 24 & 68 & 63 & 4 & 4 & 2 \\
103 & 77 & 94 & 98 & 25 & 56 & 61 & 1 & 7 & 6 \\
\midrule
{Average} & {70.33} & {96.29} & {96.21} & {12.00} & {50.04} & {50.29} & {3.25} & {7.46} & {8.38} \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/4427 | 684479 | 317,546 |
https://tex.stackexchange.com/questions/473038 | 1 | With the new packages, I get an error message for every tex-file using PStricks. It seems to be a compatibility problem between new versions of pgf and pstricks. I tried to solve the problem by using an old version of PStricks, following advices from this post : [PSTricks: Newly introduced error in package](https://tex.stackexchange.com/questions/469005/pstricks-newly-introduced-error-in-package) , but the error remains.
Here is the message I get, in short :
```
Paragraph ended before \ProvidesPackageRCS@i was complete. \par l.11
```
And in length :
```
("C:\Program Files\MiKTeX 2.9\tex/latex/pstricks\pstricks.sty"
Package: pstricks 2018/12/21 v0.69 LaTeX wrapper for `PSTricks' (RN,HV)
("C:\Program Files\MiKTeX 2.9\tex/latex/iftex\iftex.sty"
Package: iftex 2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX,
and LuaTeX
)
("C:\Program Files\MiKTeX 2.9\tex/latex/tools\shellesc.sty"
Package: shellesc 2016/06/07 v0.02a unified shell escape interface for LaTeX
Package shellesc Info: Restricted shell escape enabled on input line 69.
)
("C:\Program Files\MiKTeX 2.9\tex/generic/xkeyval\pst-xkey.tex"
File: pst-xkey.tex 2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
("C:\Program Files\MiKTeX 2.9\tex/latex/xkeyval\xkeyval.sty"
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)
("C:\Program Files\MiKTeX 2.9\tex/generic/xkeyval\xkeyval.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/xkeyval\xkvutils.tex"
\XKV@toks=\toks48
\XKV@tempa@toks=\toks49
)
\XKV@depth=\count339
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
)))
(pstricks.tex ("C:\Program Files\MiKTeX 2.9\tex/generic/pstricks\pst-fp.tex"
`pst-fp' v0.05, 2010/01/17 (hv)
\pstFP@xs=\count340
\pstFP@xia=\count341
\pstFP@xib=\count342
\pstFP@xfa=\count343
\pstFP@xfb=\count344
\pstFP@rega=\count345
\pstFP@regb=\count346
\pstFP@regs=\count347
\pstFP@times=\count348
)
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/utilities\pgfutil-common.tex"
\pgfutil@everybye=\toks50
\pgfutil@tempdima=\dimen266
\pgfutil@tempdimb=\dimen267
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/utilities\pgfutil-common-lists.te
x")) ("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/utilities\pgfkeys.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/utilities\pgffor.code.tex"
Runaway argument?
] {pgffor.code.tex}
! Paragraph ended before \ProvidesPackageRCS@i was complete.
<to be read again>
\par
l.11
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/math\pgfmath.code.tex")
\pgffor@iter=\dimen268
\pgffor@skip=\dimen269
\pgffor@stack=\toks51
\pgffor@toks=\toks52
)
\psLoopIndex=\count349
`PSTricks' v2.92 <2018/12/27> (tvz,hv)
\pst@dima=\dimen270
\pst@dimb=\dimen271
\pst@dimc=\dimen272
\pst@dimd=\dimen273
\pst@dimg=\dimen274
\pst@dimh=\dimen275
\pst@dimm=\dimen276
\pst@dimn=\dimen277
\pst@dimo=\dimen278
\pst@dimp=\dimen279
\pst@hbox=\box82
\pst@ibox=\box83
\pst@boxg=\box84
\pst@cnta=\count350
\pst@cntb=\count351
\pst@cntc=\count352
\pst@cntd=\count353
\pst@cntg=\count354
\pst@cnth=\count355
\pst@cntm=\count356
\pst@cntn=\count357
\pst@cnto=\count358
\pst@cntp=\count359
\@zero=\count360
\pst@toks=\toks53
("C:\Program Files\MiKTeX 2.9\tex/generic/pstricks\pstricks.con")
\psunit=\dimen280
\psxunit=\dimen281
\psyunit=\dimen282
\pst@C@@rType=\count361
\pslinewidth=\dimen283
\psk@startLW=\dimen284
\psk@endLW=\dimen285
\pst@customdefs=\toks54
\pslinearc=\dimen286
\pst@symbolStep=\dimen287
\pst@symbolWidth=\dimen288
\pst@symbolLinewidth=\dimen289
\everypsbox=\toks55
\psframesep=\dimen290
\pslabelsep=\dimen291
\sh@wgridXunit=\dimen292
\sh@wgridYunit=\dimen293
\pst@shift=\dimen294
)
File: pstricks.tex 2018/12/27 v2.92 `PSTricks' (tvz,hv)
("C:\Program Files\MiKTeX 2.9\tex/generic/pstricks\pst-fp.tex")
File: pst-fp.tex 2018/12/27 v2.92 `PST-fp' (hv)
)
("C:\Program Files\MiKTeX 2.9\tex/latex/pst-grad\pst-grad.sty"
Package: pst-grad 2004/07/15 package wrapper for pst-grad.tex (hv)
("C:\Program Files\MiKTeX 2.9\tex/generic/pst-grad\pst-grad.tex"
`pst-grad' v1.06, 2006/11/27 (tvz,dg,hv))
File: pst-grad.tex 2006/11/27 1.06 `pst-grad' (tvz)
)
("C:\Program Files\MiKTeX 2.9\tex/latex/pgfplots\pgfplots.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplots.revision.tex")
Package: pgfplots 2018/03/28 v1.16 Data Visualization (1.16)
("C:\Program Files\MiKTeX 2.9\tex/latex/pgf/frontendlayer\tikz.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/pgf/utilities\pgffor.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/pgf/utilities\pgfkeys.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/utilities\pgfkeys.code.tex"))
("C:\Program Files\MiKTeX 2.9\tex/latex/pgf/math\pgfmath.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/math\pgfmath.code.tex"))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/utilities\pgffor.code.tex"
Runaway argument?
] {pgffor.code.tex}
! Paragraph ended before \ProvidesPackageRCS@i was complete.
<to be read again>
\par
l.11
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/math\pgfmath.code.tex")
\pgffor@iter=\dimen295
\pgffor@skip=\dimen296
\pgffor@stack=\toks56
\pgffor@toks=\toks57
))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/frontendlayer/tikz\tikz.code.tex"
Runaway argument?
] {tikz.code.tex}
! Paragraph ended before \ProvidesPackageRCS@i was complete.
<to be read again>
\par
l.11
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/libraries\pgflibraryplothandlers.
code.tex"
File: pgflibraryplothandlers.code.tex 2019/01/05 v3.1 (3.1)
\pgf@plot@mark@count=\count362
\pgfplotmarksize=\dimen297
)
\tikz@lastx=\dimen298
\tikz@lasty=\dimen299
\tikz@lastxsaved=\dimen300
\tikz@lastysaved=\dimen301
\tikzleveldistance=\dimen302
\tikzsiblingdistance=\dimen303
\tikz@figbox=\box85
\tikz@figbox@bg=\box86
\tikz@tempbox=\box87
\tikz@tempbox@bg=\box88
\tikztreelevel=\count363
\tikznumberofchildren=\count364
\tikznumberofcurrentchild=\count365
\tikz@fig@count=\count366
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/modules\pgfmodulematrix.code.tex"
File: pgfmodulematrix.code.tex 2019/01/05 v3.1 (3.1)
\pgfmatrixcurrentrow=\count367
\pgfmatrixcurrentcolumn=\count368
\pgf@matrix@numberofcolumns=\count369
)
\tikz@expandcount=\count370
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/frontendlayer/tikz/libraries\tikz
librarytopaths.code.tex"
File: tikzlibrarytopaths.code.tex 2019/01/05 v3.1 (3.1)
)))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplots.code.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplotscore.code.tex"
\t@pgfplots@toka=\toks58
\t@pgfplots@tokb=\toks59
\t@pgfplots@tokc=\toks60
\pgfplots@tmpa=\dimen304
\c@pgfplots@coordindex=\count371
\c@pgfplots@scanlineindex=\count372
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/sys\pgfplotssysgeneric.code.
tex"))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/libs\pgfplotslibrary.code.te
x")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/oldpgfcompatib\pgfplotsoldpg
fsupp_loader.code.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/libraries\pgflibraryfpu.code.tex"
)
Package pgfplots: loading complementary arithmetics for your pgf version...
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/oldpgfcompatib\pgfplotsoldpg
fsupp_pgflibraryfpu.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/oldpgfcompatib\pgfplotsoldpg
fsupp_pgfmathfloat.code.tex"
\c@pgfmathroundto@lastzeros=\count373
))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/util\pgfplotsutil.code.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/liststructure\pgfplotslistst
ructure.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/liststructure\pgfplotslistst
ructureext.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/liststructure\pgfplotsarray.
code.tex"
\c@pgfplotsarray@tmp=\count374
)
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/liststructure\pgfplotsmatrix
.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/numtable\pgfplotstableshared
.code.tex"
\c@pgfplotstable@counta=\count375
\t@pgfplotstable@a=\toks61
)
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/liststructure\pgfplotsdeque.
code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/util\pgfplotsbinary.code.tex
"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/util\pgfplotsbinary.data.cod
e.tex"))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/util\pgfplotsutil.verb.code.
tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/libs\pgflibrarypgfplots.surf
shading.code.tex"
\c@pgfplotslibrarysurf@no=\count376
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/sys\pgflibrarypgfplots.surfs
hading.pgfsys-dvipdfmx.def"
\c@pgfplotslibrarysurf@streamlen=\count377
)))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/util\pgfplotscolormap.code.t
ex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots/util\pgfplotscolor.code.tex"
))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplotsstackedplots.code.te
x")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplotsplothandlers.code.te
x"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplotsmeshplothandler.code
.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplotsmeshplotimage.code.t
ex")))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplots.scaling.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplotscoordprocessing.code
.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplots.errorbars.code.tex"
) ("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplots.markers.code.tex"
) ("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplotsticks.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgfplots\pgfplots.paths.code.tex")
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/frontendlayer/tikz/libraries\tikz
librarydecorations.code.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/modules\pgfmoduledecorations.code
.tex"
\pgfdecoratedcompleteddistance=\dimen305
\pgfdecoratedremainingdistance=\dimen306
\pgfdecoratedinputsegmentcompleteddistance=\dimen307
\pgfdecoratedinputsegmentremainingdistance=\dimen308
\pgf@decorate@distancetomove=\dimen309
\pgf@decorate@repeatstate=\count378
\pgfdecorationsegmentamplitude=\dimen310
\pgfdecorationsegmentlength=\dimen311
)
\tikz@lib@dec@box=\box89
)
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/frontendlayer/tikz/libraries\tikz
librarydecorations.pathmorphing.code.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/libraries/decorations\pgflibraryd
ecorations.pathmorphing.code.tex"))
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/frontendlayer/tikz/libraries\tikz
librarydecorations.pathreplacing.code.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/libraries/decorations\pgflibraryd
ecorations.pathreplacing.code.tex"))
\pgfplots@numplots=\count379
\pgfplots@xmin@reg=\dimen312
\pgfplots@xmax@reg=\dimen313
\pgfplots@ymin@reg=\dimen314
\pgfplots@ymax@reg=\dimen315
\pgfplots@zmin@reg=\dimen316
\pgfplots@zmax@reg=\dimen317
)
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/frontendlayer/tikz/libraries\tikz
libraryplotmarks.code.tex"
File: tikzlibraryplotmarks.code.tex 2019/01/05 v3.1 (3.1)
("C:\Program Files\MiKTeX 2.9\tex/generic/pgf/libraries\pgflibraryplotmarks.cod
e.tex"
File: pgflibraryplotmarks.code.tex 2019/01/05 v3.1 (3.1)
)))
\c@defi=\count380
\c@meth=\count381
\c@metho=\count382
\c@prop=\count383
```
| https://tex.stackexchange.com/users/180714 | Incompatibility between PGF and PStricks | false | You should just be able to edit the file `C:\Program Files\MiKTeX 2.9\tex/generic/pgf/utilities\pgffor.code.tex` and comment out the line `\ProvidesPackageRCS{pgffor.code.tex}`.
| -1 | https://tex.stackexchange.com/users/155140 | 684483 | 317,547 |
https://tex.stackexchange.com/questions/479767 | 1 |
```
\documentclass[12pt,a4paper]{book}
\usepackage[english,greek]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{pstricks}
\usepackage{epsfig}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{graphicx}
\usepackage{url}
\usepackage{undertilde}
\usepackage{enumerate, multicol}
\usepackage{float}
\usepackage{cancel}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{polynom,xpatch}
\usepackage{lipsum}
```
I get error on line 11 file: `C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgffor.code.tex`
Message:
>
>
> ```
> ! Paragraph ended before \ProvidesPackageRCS@i was complete.
> <to be read again>
> \par
> l.11
> I suspect you've forgotten a `}', causing me to apply this
> control sequence to too much text. How can we recover?
> My plan is to forget the whole thing and hope for the best.
>
> ```
>
>
I updated my MiKTeX and Texmaker and I got the same error now I get the same error even on my previous version (which worked just fine before update).
| https://tex.stackexchange.com/users/183607 | pgffor.code.tex Error? | false | You should just be able to edit `C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgffor.code.tex` and comment out line 11. Everything should work fine without that file having the `ProvidesPackageRCS` line.
| -1 | https://tex.stackexchange.com/users/155140 | 684484 | 317,548 |
https://tex.stackexchange.com/questions/684372 | 1 | I had used a sum with `\newcounter` and `\addtocounter` in a longtable and everything worked fine but the usage was a little complicated.
With egreg's help I was able to create a latex3 version to create a sum of different time units and then display the result in a understandable form: [earlier question that was answered](https://tex.stackexchange.com/questions/684289/while-loop-leads-to-missing-number-treated-to-zero-with-latex3?noredirect=1#comment1697809_684289)
Everything works fine, but when I tried to use it in a longtable the sum gets reset every line. Why is that and how I prevent that?
```
\documentclass[parskip=full]{scrlttr2}
\renewcommand\familydefault{\sfdefault}
\usepackage[defaultsans, scale=0.9]{opensans}
\ExplSyntaxOn
\NewDocumentCommand{\newtime}{m}
{
\fp_new:c { l_timecalc_time_#1_fp }
}
\newtime{default} % initialize one
% \addtime* will also show the added time
\NewDocumentCommand{\addtime}{sO{default}mm}
{
\timecalc_time_add:nnn { #2 } { #3 } { #4 }
% with \addtime* also show what's been added
\IfBooleanT{#1}{#3\,\textup{#4}}
}
\NewDocumentCommand{\strtime}{O{default}}
{
\timecalc_time_str:n { #1 }
}
\int_new:N \l__timecalc_time_days_int
\int_new:N \l__timecalc_time_hours_int
\int_new:N \l__timecalc_time_minutes_int
\cs_new_protected:Nn \timecalc_time_add:nnn
{
\str_case:nnF { #3 }
{
{h}{ \fp_add:cn { l_timecalc_time_#1_fp } { #2 * 60 } }
{d}{ \fp_add:cn { l_timecalc_time_#1_fp } { #2 * 60 * 24 } }
{min}{ \fp_add:cn { l_timecalc_time_#1_fp } { #2 } }
}
{\ERROR}
}
\cs_new_protected:Nn \int_div_mod:nnn {
\int_set:Nn #3
{ \int_div_truncate:nn { #1 } { #2 } }
\int_set:Nn #1
{ \int_mod:nn { #1 } { #2 } }
}
\cs_new_protected:Nn \timecalc_time_str:n
{
% round to an integral number of minutes
\int_set:Nn \l__timecalc_time_minutes_int
{ \fp_eval:n { round( \fp_use:c { l_timecalc_time_#1_fp }, 0 ) } }
% compute and remove the number of days
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{1440}{\l__timecalc_time_days_int}
% compute and remove the number of hours
\int_div_mod:nnn{\l__timecalc_time_minutes_int}{60}{\l__timecalc_time_hours_int}
% now print the days
\int_compare:nT { \l__timecalc_time_days_int > 0 }
{ \int_eval:n { \l__timecalc_time_days_int }\,\textup{d}\; }
% now print the hours
\int_compare:nTF { \l__timecalc_time_hours_int > 0 }
{
\int_eval:n { \l__timecalc_time_hours_int }\,\textup{h}\;
}
{% no hours
%\unkern
}
% now print the minutes
\int_compare:nTF { \l__timecalc_time_minutes_int > 0 }
{
\int_eval:n { \l__timecalc_time_minutes_int }\,\textup{min}
}
{% no minutes
%\unkern
}
}
\ExplSyntaxOff
\usepackage{longtable}[=v4.13]
\usepackage{tabu}%
\begin{document}
\begin{letter}{recipient}
\opening{opening}
\begin{longtable}{c}
\textbf{time}
\endhead
\addtime*{20.5}{h}\\
\addtime*{30}{min}\\
\addtime*{2.7}{d}\\
\end{longtable}
This leads to a complete time of \strtime.
Normal sum:
\addtime*{20.5}{h}
\addtime*{30}{min}
\addtime*{2.7}{d}
This leads to a complete time of \strtime.
\closing{concluding text}
\end{letter}
\end{document}
```
P.S.: Also `\unkern` breaks the in longtable and therefore had to be uncommented.
| https://tex.stackexchange.com/users/281557 | Summing does not work in longtable | false | A solution for `lualatex`:
```
\documentclass[parskip=full]{scrartcl}
\usepackage{luacode}
\begin{luacode*}
function addtime(value, unit)
if unit == "d" then
value = value * 24 * 60
elseif unit == "h" then
value = value * 60
end
return value
end
function gettime(name)
days = name//1440
name = name - days * 1440
hours = name//60
minutes = math.floor(name - hours * 60)
return (tostring(days).."\\,d, "..tostring(hours).."\\,h, "..tostring(minutes).."\\,min")
end
\end{luacode*}
\newcommand*\settime[1][default]{\directlua{ #1 = 0 }}
\settime
\newcommand*\addtime[3][default]{%
#2 #3
\directlua{ #1 = #1 + addtime(#2,"#3") }}
\newcommand*\gettime[1][default]{%
\directlua{ tex.print( gettime(#1)) }}
\usepackage{longtable}
\begin{document}
\begin{longtable}{c}
\textbf{time}
\endhead
\addtime{20.5}{h}\\
\addtime{30}{min}\\
\addtime{2.7}{d}\\
\end{longtable}
This leads to a complete time of \gettime.
Normal sum:
\addtime{20.5}{h}
\addtime{30}{min}
\addtime{2.7}{d}
This leads to a complete time of \gettime.
\end{document}
```
| 1 | https://tex.stackexchange.com/users/187802 | 684491 | 317,554 |
https://tex.stackexchange.com/questions/684465 | 0 | There is an error I have that i absolutely don't understand: it comes from this article from which i am trying to include the reference:
<https://pubs.acs.org/doi/10.1021/jp993642l>
```
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.1158 ...benzene, naphthalene, and anthracene:
crossed and
You may provide a definition with
\DeclareUnicodeCharacter
[134] [135] [136]) [137] (./output.aux (./Titlepage.aux) (./Kurzzusammenfassung.aux) (./Acronyms_defs.aux) (./Own_publications.aux) (./Chapters/Introduction.aux) (./Chapters/Chapter_1.aux) (./Chapters/Chapter_2.aux) (./Chapters/Chapter_3.aux) (./Chapters/Chapter_3bis.aux) (./Chapters/Chapter_4.aux) (./Chapters/Chapter_5.aux) (./Chapters/Chapter_6.aux) (./Chapters/Conclusion.aux))
Package rerunfilecheck Info: File `output.out' has not changed.
(rerunfilecheck) Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
)
```
I am adding the reference myself:
```
@article{gonzalez_quantum_2000,
author = {Gonzalez, Carlos and Lim, Edward C.},
title = {A Quantum Chemistry Study of the van der Waals Dimers of Benzene, Naphthalene, and Anthracene: Crossed and Parallel-Displaced Dimers of Very Similar Energies in the Linear Polyacenes},
journal = {The Journal of Physical Chemistry A},
volume = {104},
number = {13},
pages = {2953-2957},
year = {2000},
doi = {https://pubs.acs.org/doi/10.1021/jp993642l},
}
```
I have no idea what is the unicode character it cannot understand, i see none...
Thank you for your help!
Best,
A.
| https://tex.stackexchange.com/users/294163 | Package inputenc error not understood | true | you only showed the last part of the error message, you omitted the main part which reports the character.
```
\documentclass{article}
\begin{document}
and Anthracene: Crossed
\end{document}
```
produces
```
! LaTeX Error: Unicode character (U+2009)
not set up for use with LaTeX.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.5 and Anthracene:
Crossed
? h
You may provide a definition with
\DeclareUnicodeCharacter
?
```
you have a U+2009 (thin space) at the point after the `:` marked by the line break.
```
\documentclass{article}
\begin{document}
and Anthracene: Crossed
\end{document}
```
runs without error
| 2 | https://tex.stackexchange.com/users/1090 | 684492 | 317,555 |
https://tex.stackexchange.com/questions/684526 | 0 | Most **LaTeX** commands have a full-English counter-part.
Some Examples of what I am looking for are shown in this posting.
What is the full English equivalent of `\stackrel`?
```
d = {
'approx' : 'approximately' ,
'cdots' : 'centered dots' ,
'cong' : 'congruent' ,
'ddot' : 'double diagonal dot' ,
'dfrac' : 'display fraction' ,
'equiv' : 'equivalent to' ,
'exists' : 'there exists' ,
'frac' : 'fraction' ,
'ge' : 'greater than or equal to' ,
'genfrac' : 'generalized fraction' ,
'iff' : 'if and only if' ,
'iiint' : 'integral integral integral' ,
'iint' : 'integral integral' ,
'infty' : 'infinity' ,
'lbrace' : 'left brace' ,
'le' : 'less than or equal to' ,
'lhd' : 'left lazy head' ,
'lim' : 'limit' ,
'lnot' : 'logical not' ,
'lt' : 'less than' ,
'mathbb' : 'mathematics black board bold' ,
'mp' : 'minus plus' ,
'mu' : 'greek letter mu' ,
'notin' : 'not element of or inside of' ,
'prod' : 'product' ,
'quad' : 'spazio quadratone' ,
'rangle' : 'rightangle' ,
'rceil' : 'rightceiling' ,
'simeq' : 'similar or equal' ,
'spadesuit' : 'spadesuitsymbol' ,
'sqrt' : 'square root' ,
'subseteq' : 'subset or equal' ,
'subsetneq' : 'subset not equal' ,
'sum' : 'summation' ,
'varepsilon' : 'variable epsilon' ,
'varliminf' : 'variable limit infimum' ,
'varlimsup' : 'variable limit supremum' ,
'varnothing' : 'variable nothing' ,
'vdash' : 'vertical dash' ,
'vdots' : 'vertical dots' ,
}
```
What is an English phrase for `\stackrel` without any letters deleted?
======================================================================
| https://tex.stackexchange.com/users/178952 | What would `\stackrel` be if you were to write it out in full as an entire English phrase? | false | As Clara suggested in her comment, `\stackrel` is short for stacked relation (relation being the “part of speech” of the symbol which determines its spacing).
Incidentally, in your list, in the various `\var`*something* commands, the `var` is short for “variant,” not “variable.”
| 3 | https://tex.stackexchange.com/users/202780 | 684528 | 317,573 |
https://tex.stackexchange.com/questions/508111 | 2 | Following the top answer to [this question](https://tex.stackexchange.com/questions/30720/footnote-without-a-marker), I've created an unnumbered footnote for use in a document like so:
```
\newcommand\blfootnote[1]{%
\begingroup
\renewcommand\thefootnote{}\footnote{#1}%
\addtocounter{footnote}{-1}%
\endgroup
\endgroup }
```
This removes the superscript number from both the main text and from the start of the footnote, but the start of the footnote is still indented. How can I change the newly defined command above so that the unnumbered footnote is not indented at the bottom of the page?
| https://tex.stackexchange.com/users/nan | Remove indent from specially defined footnote command | false | The space used for the footnote number in the footnote is `1.8em`, stemming from the definition of `\@makefntext`. The following fixes your issue by removing the indent.
```
\documentclass{article}
\NewDocumentCommand{\blfootnote}{ m }{{%
\RenewDocumentCommand{\thefootnote}{}{\roman{footnote}}% roman{0} = empty
\footnotetext[0]{\hspace*{-1.8em}#1}% Undo 1.8em indent
}}%
\begin{document}
Some text\blfootnote{A footnote without marker} and some more text\footnote{A standard footnote}
Test
\end{document}
```
Additionally, it sets the footnote number as `0`, which printed in `\roman` (only temporarily within `\blfootnote`; note the double braces/group) is empty.
| 1 | https://tex.stackexchange.com/users/5764 | 684530 | 317,574 |
https://tex.stackexchange.com/questions/684531 | 1 | I am using pandoc to convert txt files to pdf. Whenever I specify a font in my metadata, I am getting the following error message, although I've checked that every font is installed:
```
% Error producing PDF.
! LaTeX Error: File `[fontname].sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
```
The following is my metadata in the txt file:
```
title: title
fontfamily: Libre Baskerville [or some other font]
fontsize: 10pt
margin-left: 1.5in
margin-right: 1.5in
margin-top: 1.5in
margin-bottom: 1.5in
indent: true
linestretch: 1.25
documentclass: article
```
And this is my command line in terminal:
```
pandoc test.txt -s -o test.pdf -V --pdf-engine=xelatex
```
I am using macos Ventura 13, Pandoc 3.1.2,MacTex-2023
Thanks!
| https://tex.stackexchange.com/users/296145 | I got this error message although every font is installed: "Error producing PDF ! LaTeX Error: File `[fontname].sty' not found" | true | Pandoc has two font loading mechanism for latex in place:
1. Using packages installed in your latex distribution with `fontfamily`. This option mainly aims for `pdflatex` + postscript fonts, but there are packages that will also support other font formats and engines.
Usage: `fontfamily: packagename` will attempt to load the package with `\usepackage{packagename}` and will only work, if `packagename.sty` can be found.
2. Using fonts installed on your system with `mainfont`. This option works only with `xelatex` and `lualatex` + open/true type fonts.
Usage: `mainfont: Font Name` will attempt to load the font using [fontspec](https://ctan.org/pkg/fontspec) with `\setmainfont{Font Name}`.
More details can be found in the [manual](https://pandoc.org/MANUAL.html#fonts) or directly in the [latex default template](https://github.com/jgm/pandoc/blob/main/data/templates/default.latex).
| 2 | https://tex.stackexchange.com/users/29873 | 684537 | 317,576 |
https://tex.stackexchange.com/questions/684543 | 1 | I get for commands `\tableofcontents`, `\listoffigures`, `\listoflistings`, and `\chapter` the same error:
```
Command \textcap unavailable in encoding T1.
```
Even cloning a fresh latex template results in this error, for example this on from GitHub: <https://github.com/timkpaine/oreilly-latex-template>
To be clear, the PDF *does* generate, but all those things are missing in the document (titles, table of contents, etc.)
Here's the preamble for that example, just for reference (sorry that it's kind of long):
```
\documentclass[a4paper,
twoside,
BCOR1.0cm,
DIV11,
parskip=full,
11pt]{scrbook}
\usepackage[standardsections]{scrhack}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xspace}
\usepackage{bera}
\usepackage{pifont}
\usepackage{amssymb}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usepackage{color}
%%%%%%%%%%%%
\DeclareFixedFont{\numcap}{T1}{phv}{bx}{n}{3cm}
\DeclareFixedFont{\textcap}{T1}{phv}{bx}{n}{1.5cm}
\DeclareFixedFont{\textaut}{T1}{phv}{bx}{n}{0.8cm}
\addtokomafont{chapter}{\color{gray}\textcap}
\addtokomafont{section}{\color{white}}
\addtokomafont{subsection}{\color{white}}
\setkomafont{pagehead}{\sffamily\small}
\setkomafont{captionlabel}{\sffamily\small\bfseries}
\setkomafont{caption}{\sffamily\small}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,
decorations.pathreplacing,decorations.pathmorphing,shapes,
matrix,shapes.symbols}
\tikzset{
punktchain/.style={
rectangle,
rounded corners,
draw=black!20, thin,
minimum height=3em,
text centered},
peu/.style={
rectangle,
fill opacity=1,
%rounded corners,
fill=white,
top color=white,
draw=black!20, thin,
%text width=10em,
%minimum height=3em,
text centered},
line/.style={draw, thin, <-},
element/.style={
tape,
top color=white,
bottom color=blue!50!black!60!,
minimum width=8em,
draw=blue!40!black!90, very thick,
text width=10em,
minimum height=3.5em,
text centered,
on chain},
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{scrlayer-scrpage}
\setlength{\headheight}{25pt}
\pagestyle{scrheadings}
\setheadwidth{textwithmarginpar}
\setheadsepline{.4pt}
\addtokomafont{headsepline}{\color{lightgray}}
\lefoot{\color{black!40}{\hrulefill}}
\cefoot{\parbox[c][.5in][c]{1cm}{\fcolorbox{black!40}{white}{\thepage}}}
\refoot{}
\lofoot{\color{black!40}{\hrulefill}}
\cofoot[{\color{black!40}{---}} {\thepage} {\color{black!40}{---}}]{\parbox[c][.5in][c]{1cm}{\fcolorbox{black!40}{white}{\thepage}}}
\rofoot[]{}
\usepackage[pdftex,
colorlinks=true,
linkcolor=blue,
filecolor=blue,
citecolor=blue,
pdftitle={Llibre amb estil},
pdfauthor={Joan Queralt Gil},
pdfsubject={tema},
pdfkeywords={Keyword1, Keyword 2},
bookmarks, bookmarksnumbered=true]{hyperref}
\tolerance=4000
\emergencystretch=20pt
\setcounter{secnumdepth}{3}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\usekomafont{sectioning} \usekomafont{chapter}\filleft}
{\numcap\textcolor[named]{gray}\thechapter}
{1em}
{}
\titleformat{\section}[block]
{\usekomafont{sectioning}\usekomafont{section}
\tikz[overlay] \fill[color=black,rounded corners=.2ex] (0,-1ex) rectangle (\textwidth-2cm,1em);}
{ \thesection}
{1em}
{}
\titleformat{\subsection}[block]
{\usekomafont{sectioning}\usekomafont{subsection}
\tikz[overlay] \fill[color=black!60] (0,-1ex) rectangle (\textwidth-2cm,1em);}
{ \thesubsection}
{1em}
{}
\usepackage{lipsum}
%%%%%%%%%%%%%%%%%%%%
\usepackage{enumitem}
\newlist{steps}{enumerate}{4}
\setlist[steps]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[steps,1]{label*=\arabic*.}
\setlist[steps,2]{label*=\arabic*.}
\setlist[steps,3]{label*=\arabic*.}
\setlist[steps,4]{label*=\arabic*.}
\newlist{points}{itemize}{4}
\setlist[points]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[points,1]{label=\tiny\ding{110}}
\setlist[points,2]{label=\tiny\ding{108}}
\setlist[points,3]{label=\tiny\ding{72}}
\setlist[points,4]{label=\tiny\ding{117}}
\newlist{objectives}{itemize}{1}
\setlist[objectives]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[objectives,1]{label=\tiny$\blacktriangleright$}
\newlist{attention}{itemize}{1}
\setlist[attention]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[attention,1]{label=\ding{224}}
\newlist{arrows}{itemize}{4}
\setlist[arrows]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[arrows,1]{label=\tiny\ding{252}}
\setlist[arrows,2]{label=\tiny\ding{212}}
\setlist[arrows,3]{label=\tiny\ding{232}}
\setlist[arrows,4]{label=\tiny\ding{217}}
%%%%%%%%%%%%%%%%%%%%
\usepackage[tikz]{bclogo}
\newcommand\novaimatge{\includegraphics[width=14pt]{write}}
\renewcommand\logowidth{14pt}
\usepackage{colortbl}
\arrayrulecolor{gray}
\let\shline\hline
\def\hline{\noalign{\vskip3pt}\shline\noalign{\vskip4pt}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%% First Page
\title{\textcap{Latex Template}}
\author{
\textaut{Joan Queralt Gil}\\http://catalatex.blogspot.com/
}
\date{\today}
\maketitle
%%%%%%%%%%%%%%%%%%%%%%
\tableofcontents
```
Here's what `latex --version` outputs:
```
pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022/Homebrew)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.39; using libpng 1.6.39
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03
```
I'm on Mac, using VS Code with LaTex Workshop. I feel like I'm missing something small that could be causing this error. It's been a while since I've worked with LaTeX, so bear with me if it's obvious!
| https://tex.stackexchange.com/users/241538 | Command \textcap unavailable in encoding T1 | true | The problem is that `hyperref` will define `\textcap` at begin document, thus overriding your font definition.
If you *really* want to mix Helvetica with Computer Modern (or other font), then use the proper way (***not*** fixed font). But a fix for your issue is to replace `\textcap` with something else, such as `\chapterfont`.
By the way, `titlesec` is not compatible with `scrbook`. And don't redefine `\hline`; rather use `booktabs` rules. Also remove the `pdftex` option.
| 2 | https://tex.stackexchange.com/users/4427 | 684545 | 317,579 |
https://tex.stackexchange.com/questions/269701 | 13 | I'm currently writing some blog content on Ghost, which uses Markdown similar to the SE Network. Unfortunately however, when attempting to subscript in math mode *i.e.* $3\_{x}$, the underscore is interpreted by Markdown as italicizing text, and prevents my math from showing up correctly.
Having already filed a support ticket, for the time being I was wondering if there is any other way to nicely subscript in math mode in LaTeX.
| https://tex.stackexchange.com/users/88588 | Are there alternative methods to "_" for subscripting in math mode? | false | On the platform I'm using, `\sb` was undefined, perhaps because it's using MathJax like @miradulo said. At least on my platform though, I was able to "escape" the underscore.
**Before:**
```
$$|A\rangle=\alpha_u|u\rangle+\alpha_d|d\rangle$$
```
**After:**
```
$$|A\rangle=\alpha\_u|u\rangle+\alpha\_d|d\rangle$$
```
| 2 | https://tex.stackexchange.com/users/29397 | 684558 | 317,587 |
https://tex.stackexchange.com/questions/16027 | 10 | I very much like the typesetting in Numdam's writeup of [Éléments de géométrie algébrique](http://archive.numdam.org/ARCHIVE/PMIHES/PMIHES_1960__4_/PMIHES_1960__4__5_0/PMIHES_1960__4__5_0.pdf). I find the font particularily pleasing, and the headers are nice as well. I've heard this is how it looked in the original release; I would like to snatch it. Does anyone know the name of the font, or does anyone have a general setup?
| https://tex.stackexchange.com/users/486 | Font and typesetting of EGA by Numdam | false | With Michael Sharpe's [`Baskervaldx`](https://www.ctan.org/pkg/baskervaldx) and [`newtxmath`](https://www.ctan.org/pkg/newtx) packages one can come fairly close to the style of EGA. For example
```
\documentclass[a4paper]{report}
\usepackage[french]{babel}
\usepackage{titlesec}
\usepackage[osf]{Baskervaldx}
\usepackage[frenchmath,baskervaldx]{newtxmath}
\titleclass{\newpara}{straight}[\subsection]
\newcounter{newpara}
\renewcommand\thenewpara{\thesubsection.\arabic{newpara}}
\titleformat{\newpara}
[runin] % shape
{\bfseries} % title and label format
{(\thenewpara)} % label
{1ex} % sep
{} % before title code
\titlespacing{\newpara}{\parindent}{0pt}{1ex}
\newcommand{\numberedpara}{\newpara{}} % the main command we'll actually use
\setcounter{secnumdepth}{4} % allows numbering for \newpara
\titleformat{\chapter}
[display] % shape
{\filcenter} % title and label format
{\Large\MakeUppercase{\chaptername}~\thechapter} % label
{4ex} % sep
{\LARGE\bfseries\MakeUppercase} % before title code
\renewcommand{\thesection}{\arabic{section}}
\titleformat{\section}
{\large\filcenter} % title and label format
{\S\;\bfseries\thesection.} % label
{1ex} % sep
{\bfseries\MakeUppercase} % before title code
\newcommand{\periodafter}[1]{#1.}
\titleformat{\subsection}
{\normalsize\bfseries}
{\thesubsection.}
{1ex}
{\periodafter}
[\setcounter{newpara}{0}]
\setcounter{chapter}{-1}
\begin{document}
\chapter{Préliminaires}
\section{Anneaux de fractions}
\setcounter{subsection}{-1}
\subsection{Anneaux et algèbres}
\numberedpara
Tous les anneaux considérés dans ce Traité posséderont un \emph{élément unité};
tous les modules sur un tel anneau seront supposés \emph{unitaires};
les homomorphismes d'anneaux seront toujours supposés \emph{transformer l'élément
unité en élément unité}; sauf mention expresse du contraire, un sous-anneau d'un
anneau $A$ sera \emph{supposé contenir Vêlement unité de} $A$. Nous considérerons
surtout des anneaux \emph{commutatifs}, et lorsque nous parlerons d'anneau sans
préciser, il sera sous-entendu qu'il s'agit d'un anneau commutatif. Si $A$ est un
anneau non nécessairement commutatif, par $A$-module nous entendrons toujours un
module \emph{à gauche}, sauf mention expresse du contraire.
\numberedpara
Soient $A,B$ deux anneaux non nécessairement commutatifs, $\varphi:A\to B$ un
homomorphisme. Tout $B$-module à gauche (resp. à droite) $M$ peut être muni
d'une structure de $A$-module à gauche (resp. à droite) en posant $a.m=\varphi(a).m$
(resp. $m.a=m.\varphi(a)$); lorsqu'il sera nécessaire de distinguer sur $M$ les
structures de $A$-module et de $B$-module, nous désignerons par $M_{[\varphi]}$ le
$A$-module à gauche (resp. à droite) ainsi défini. Si $L$ est un $A$-module, un
homomorphisme $u:L\to M_{[\varphi]}$ est donc un homomorphisme de groupes commutatifs
tel que $u(a.x)=\varphi(a).u(x)$ pur $a\in A$, $x\in L$; on dira aussi que c'est un
\emph{$\varphi$-homomorphisme} $L\to M$, et que le couple $(\varphi,u)$ (ou, par abus
de language, $u$) est un \emph{di-homomorphisme} de $(A,L)$ dans $(B,M)$. Les couples
$(A,L)$ formés d'un anneau $A$ et d'un $A$-module $L$ formet donc une \emph{catégorie}
pour laquelle les morphismes sont les di-homomorphismes.
\numberedpara
Sous les hypothèses de (1.0.2), si $\mathfrak{I}$ est un idéal à gauche (resp. à droite)
de $A$, nous noterons $B\mathfrak{I}$ (resp. $\mathfrak{I}B$) l'idéal à gauche (resp. à
droite) $B\varphi(\mathfrak{I})$ (resp. $\varphi(\mathfrak{I})B$) de $B$ engendré par
$\varphi(\mathfrak{I})$; c'est aussi l'image de l'homomorphisme canonique
$B\otimes_A \mathfrak{I}\to B$ (resp. $\mathfrak{I}\otimes_A B\to B$) de $B$-modules à
gauche (resp. à droite).
\vdots
\section{Espaces Irréductibles. Espaces Noethériens}
\subsection{Espaces irréductibles}
\end{document}
```
Note the `baskervaldx` option of `newtxmath` which gives the Baskervald italic lowercase letters in math.
If you plan to use this setup for a document in English, your preamble might look instead like
```
\documentclass{report}
\usepackage{titlesec} % comment out if not using fancy titles
\usepackage[osf]{Baskervaldx}
\usepackage[baskervaldx]{newtxmath}
```
---
If you *really* want to imitate the style of EGA, this should be a start:
### Source:
```
\documentclass{EGAstyle}
\setcounter{chapter}{-1} % EGA starts with chapter 0
\begin{document}
\chapter{Préliminaires}
\section{Anneaux de fractions}
\setcounter{subsection}{-1}
\subsection{Anneaux et algèbres}
\numberedpara
Tous les anneaux considérés dans ce Traité posséderont un \emph{élément unité};
tous les modules sur un tel anneau seront supposés \emph{unitaires};
les homomorphismes d'anneaux seront toujours supposés \emph{transformer l'élément
unité en élément unité}; sauf mention expresse du contraire, un sous-anneau d'un
anneau $A$ sera \emph{supposé contenir Vêlement unité de} $A$. Nous considérerons
surtout des anneaux \emph{commutatifs}, et lorsque nous parlerons d'anneau sans
préciser, il sera sous-entendu qu'il s'agit d'un anneau commutatif. Si $A$ est un
anneau non nécessairement commutatif, par $A$-module nous entendrons toujours un
module \emph{à gauche}, sauf mention expresse du contraire.
\numberedpara \label{homom-def}
Soient $A,B$ deux anneaux non nécessairement commutatifs, $\varphi:A\to B$ un homomorphisme.
Tout $B$-module à gauche (resp. à droite) $M$ peut être muni d'une structure de $A$-module
à gauche (resp. à droite) en posant $a.m=\varphi(a).m$ (resp. $m.a=m.\varphi(a)$); lorsqu'il
sera nécessaire de distinguer sur $M$ les structures de $A$-module et de $B$-module, nous
désignerons par $M_{[\varphi]}$ le $A$-module à gauche (resp. à droite) ainsi défini. Si
$L$ est un $A$-module, un homomorphisme $u:L\to M_{[\varphi]}$ est donc un homomorphisme
de groupes commutatifs tel que $u(a.x)=\varphi(a).u(x)$ pur $a\in A$, $x\in L$; on dira
aussi que c'est un \emph{$\varphi$-homomorphisme} $L\to M$, et que le couple $(\varphi,u)$
(ou, par abus de language, $u$) est un \emph{di-homomorphisme} de $(A,L)$ dans $(B,M)$. Les
couples $(A,L)$ formés d'un anneau $A$ et d'un $A$-module $L$ formet donc une \emph{catégorie}
pour laquelle les morphismes sont les di-homomorphismes.
\numberedpara
Sous les hypothèses de (\ref{homom-def}), si $\mathfrak{I}$ est un idéal à gauche (resp. à
droite) de $A$, nous noterons $B\mathfrak{I}$ (resp. $\mathfrak{I}B$) l'idéal à gauche (resp.
à droite) $B\varphi(\mathfrak{I})$ (resp. $\varphi(\mathfrak{I})B$) de $B$ engendré par
$\varphi(\mathfrak{I})$; c'est aussi l'image de l'homomorphisme canonique
$B\otimes_A \mathfrak{I}\to B$ (resp. $\mathfrak{I}\otimes_A B\to B$) de $B$-modules à gauche
(resp. à droite).
\numberedpara
Si $A$ est un anneau (commutatif), $B$ un anneau non nécessairement commutatif, la donnée d'une
structure de \emph{$A$-algèbre} sur $B$ équivaut à la donnée d'un homomorphisme d'anneaux
$\varphi:A\to B$ tel que $\varphi(A)$ soit contenu dans le centre de $B$. Pour tout idéal
$\mathfrak{I}$ de $A$, $\mathfrak{I}B=B\mathfrak{I}$ est alors un idéal bilatère de $B$, et pour
tout $B$-module $M$, $\mathfrak{I}M$ est alors un $B$-module égal à $(B\mathfrak{I})M$.
\numberedpara
Nous ne reviendrons pas sur les notions de \emph{module de type fini} et d'\emph{algèbre}
(commutative) \emph{de type fini}; dire qu'un $A$-module $M$ est de type fini signifie qu'il
existe une suite exacte $A^p\to M\to 0$. On dit qu'un $A$-module $M$ admet une \emph{présentation finie}
s'il est isomorphe au conoyau d'un homomorphisme $A^p\to A^q$, autrement dit s'il existe une suite
exacte $A^p\to A^q\to M\to 0$. On notera que sur un anneau \emph{noethérien} $A$, tout $A$-mdoule
de type fini admet une présentation finie.
\section{Espaces Irréductibles. Espaces Noethériens}
\subsection{Espaces irréductibles}
\numberedpara
On dit qu'un espace topologique $X$ est \emph{irréductible} s'il est non vide et s'il n'est pas
réunion de deux sous-espaces fermés distincts de $X$. Il revient au même de dire que $X\neq\emptyset$
et que l'intersection de deux ouverts (et par suite d'un nombre fini d'ouverts) non vides de $X$
est non vide, ou que tout ouvert non vide est partout dense, ou que toute partie fermée $\neq X$
est \emph{rare}, ou enfin que tout ouvert de X est \emph{connexe}.
\numberedpara
Pour qu'un sous-espace $Y$ d'un espace topologique $X$ soit irréductible, il faut et il suffit que
son adhérence $\overline{Y}$ soit irréductible. En particulier, tout sous-espace qui est l'adhérence
$\overline{\{x\}}$ d'un sous-espace réduit à un point est irréductible; nous exprimerons la relation
$y\in\overline{\{x\}}$ (équivalente à $\overline{\{y\}}\subset \overline{\{x\}}$ en disant que $y$
est \emph{spécialisation de} $x$ ou que $x$ est une \emph{générisation de} $y$. Lorsqu'il existe
dans un espace irréductible $X$ un point $x$ tel que $X=\overline{\{x\}}$, nous dirons que $x$ est
\emph{point générique} de $X$. Tout ouvert non vide de $X$ contient alors $x$ et tout sous-espace
contenant $x$ admet $x$ pour point générique.
\numberedpara
Rappelons qu'on appelle \emph{espace de Kolmogoroff} un espace topologique $X$
vérifiant l'axiome de séparation:
$(T_0)$ Si $x\neq y$ sont deux points quelconques de $X$, il existe un ensemble ouvert contenant
l'un des points $x,y$ et non l'autre.
Si un espace de Kolmogoroff irréductible admet un point générique, il n'en admet
qu'\emph{un seul} puisqu'un ouvert non vide contient tout point générique.
\section{Compléments sur les faisceaux}
\subsection{Faisceaux à valeurs dans une catégorie}
\numberedpara \label{probleme-uni}
Soient $\boldK$ une catégorie, $(A_\alpha)_{\alpha\in I}$, $(A_{\alpha\beta})_{(\alpha,\beta)\in I\times I}$
deux familles d'objets de $\boldK$ telles que $A_{\beta\alpha}=A_{\alpha\beta}$,
$(\rho_{\alpha\beta})_{(\alpha,\beta)\in I\times I}$ une famille de morphismes
$\rho_{\alpha\beta}:A_\alpha\to A_{\alpha\beta}$. Nous dirons qu'un couple formé d'un objet $A$
de $\boldK$ et d'une famille de morphismes $\rho_\alpha:A\to A_\alpha$ est \emph{solution du problème universel}
défini par la donnée des familles $(A_\alpha)$, $(A_{\alpha\beta})$ et $(\rho_{\alpha\beta})$ si,
pour tout objet $B$ de $\boldK$, l'application qui, à tout $f\in\Hom(B,A)$ fait correspondre la
famille $(\rho_\alpha\circ f)\in \prod_\alpha\Hom(B,A_\alpha)$ est une \emph{bijection} de
$\Hom(B,A)$ sur l'ensemble des $(f_\alpha)$ telles que
$\rho_{\alpha\beta}\circ f_\alpha = \rho_{\beta\alpha}\circ f_\beta$ pour tout couple d'indices
$(\alpha,\beta)$. On voit aussitôt que s'il existe une telle solution, elle est unique à un isomorphisme près.
\numberedpara
Nous ne rappellerons pas la définition d'un \emph{préfaisceau} $U\to \mathscr{F}(U)$ sur un
espace topologique $X$, à valeurs dans une catégorie $\boldK$ (G, I, 1.9); nous dirons qu'un
tel préfaisceau est un faisceau à valeurs dans $\boldK$ s'il satisfait à l'axiome suivant:
(F) {\itshape Pour tout recouvrement $(U_\alpha)$ d'un ouvert $U$ de $X$ par des ouverts
$U_\alpha$ contenus dans $U$, si on désigne par $\rho_\alpha$ \emph{(resp. $\rho_{\alpha\beta}$)}
le morphisme de restriction
\[\mathscr{F}(U)\to \mathscr{F}(U_\alpha) \quad \textup{(resp. $\mathscr{F}(U_\alpha)\to \mathscr{F}(U_\alpha\cap U_\beta)$),}\]
le couple formé de $\mathscr{F}(U)$ et de la famille $(\rho_\alpha)$ est solution du problème
universel pour $(\mathscr{F}(U_\alpha))$, $(\mathscr{F}(U_\alpha\cap U_\beta))$ et
$(\rho_{\alpha\beta})$} (\ref{probleme-uni}) \footnote{C'est un cas particulier de la notion
générale de \emph{limite projective} (non filtrante) (\emph{voir} (T, 1, 1.8) et le livre en
préparation annoncé dans l'Introduction).}.
\begingroup
\renewcommand{\thechapter}{PREMIER}
\chapter{Le langage des schémas}
\endgroup
\ChapterTOC
Les §§ i à 8 ne font guère que développer un langage, celui qui sera utilisé dans
toute la suite. Notons cependant que, conformément à l'esprit général de ce Traité,
les §§ 7 et 8 seront moins utilisés que les autres, et de façon moins essentielle;
on n'a d'ailleurs parlé des schémas de Chevalley que pour faire le lien avec le
langage de Chevalley [i] et Nagata [9]. Le § 9 donne des définitions et résultats
sur les faisceaux quasi-cohérents, dont certains ne se bornent plus à une traduction
en langage «géométrique» de notions connues d'Algèbre commutative, mais sont déjà
de nature globale; ils seront indispensables, dès les chapitres suivants, dans
l'étude globale des morphismes. Enfin, le § 10 introduit une généralisation de la
notion de schéma, qui nous servira d'intermédiaire au chapitre III pour formuler
et démontrer de façon commode les résultats fondamentaux de l'étude cohomologique
des morphismes propres ; par ailleurs, signalons que la notion de schéma formel
semble indispensable pour exprimer certains faits de la «théorie des modules»
(problèmes de classification des variétés algébriques). Les résultats du § 10 ne
seront pas utilisés avant le § 3 du chapitre III et il est recommandé d'en omettre
la lecture jusque-là.
\section{Schémas affines}
\subsection{Le spectre premier d'un anneau}
\numberedpara
\textit{Notations:} Soient $A$ un anneau (commutatif), $M$ un $A$-module. Dans
ce chapitre et les suivants, nous utiliserons constamment les notations suivantes:
$\Spec(A)=$ \emph{ensemble des idéaux premiers} de $A$, appelé aussi
\emph{spectre premier} de $A$; pour un $x\in X=\Spec(A)$, il sera souvent commode
d'écrire $\mathfrak{j}_x$ au lieu de $x$. Pour que $\Spec(A)$ soit \emph{vide},
il faut et il suffiet que l'anneau $A$ soit réduit à 0.
$A_x=A_{\mathfrak{j}_x}=$ \emph{anneau (local) des fractions} $S^{-1}A$, où $S=A-\mathfrak{j}_x$.
$\mathfrak{m}_x=\mathfrak{j}_xA_{\mathfrak{j}_x}=$ \emph{idéal maximal de} $A_x$.
$\resfield(x)=A_x/\mathfrak{m}_x=$ \emph{corps résiduel de} $A_x$, isomorphe
canoniquement au corps des fractions de l'anneau intègre $A/\mathfrak{j_x}$,
auquel on l'identifie.
$f(x)=$ \emph{classe de} $f$ mod. $\mathfrak{j}_x$, dans $A/\mathfrak{j}_x\subset \resfield(x)$,
pour $f\in A$ et $x\in X$. On dit encore que $f(x)$ est le \emph{valeur} de $f$ au
point $x\in\Spec(A)$; les relations $f(x)=0$ et $f\in\mathfrak{j}_x$ sont équivalentes.
$M_x=M\otimes_A A_x=$ \emph{module des fractions à dénominateurs dans} $A-\mathfrak{j}_x$.
$\mathfrak{r}(E)=$ \emph{racine de l'idéal de $A$ engendré par une partie $E$ de $A$}.
$V(E)=$ \emph{ensemble des $x\in X$ tels que $E\subset \mathfrak{j}_x$}
(ou encore ensemble des $x\in X$ te;s que $f(x)=0$ pour tout $f\in E$),
pour $E\subset A$. On a donc
\begin{equation} \label{radical}
\mathfrak{r}(E) = \bigcap_{x\in V(E)} \mathfrak{j}_x
\end{equation}
$V(f)=V(\{f\})$ pour $f\in A$.
$D(f)=X-V(f)=$ \emph{ensemble des $x\in X$ où $f(x)\neq 0$}.
\begin{proposition}[label=vanishing-props]
On a les propriétés suivantes:
\begin{enumerate}
\item $V(0)=X$, $V(1)=\emptyset$.
\item La relation $E\subset E'$ entraîne $V(E)\supset V(E')$.
\item Pour toute famille $(E_\lambda)$ de parties de $A$, $V(\bigcup_\lambda E_\lambda)=V(\sum_\lambda E_\lambda)=\bigcap_\lambda V(E_\lambda)$.
\item $V(EE')=V(E)\cup V(E')$.
\item $V(E)=V(\mathfrak{r}(E))$.
\end{enumerate}
\end{proposition}
Les propriétés (i), (ii), (iii) sont triviales, et (v) résulte de (ii)
et de la formule (\ref{radical}). Il est évident que $V(EE')\supset V(E)\cup V(E')$;
inversement, se $x\notin V(E)$ et $x\notin V(E')$, il existe $f\in E$ set
$f'\in E'$ tels que $f(x)\neq 0$ et $f'(x)\neq 0$ dans $\resfield(x)$,
d'où $f(x)f'(x)\neq 0$, autrement dit $x\notin V(EE')$, ce qui prouve (iv).
La prop. (\ref{vanishing-props}) montre entre autres que les ensembles
de la forme $V(E)$ (où $E$ parcourt l'ensemble des parties de $A$) sont
les \emph{ensembles fermés} d'une topologie sur $X$, que nous appellerons
la \emph{topologie spectrale} \footnote{L'introduction de cette topologie
en géométrie algébrique est due à Zariski. Aussi est-elle souvent appelée
la «topologie de Zariski» de $X$}; sauf mention expresse du contraire,
on supposera toujours $X=\Spec(A)$ muni de la topologie spectrale.
\section{Préschémas et morphismes de préschémas}
\section{Produits de préschémas}
\section{Sous-préschémas et morphismes d'immersion}
\section{Préschémas réduits; condition de séparation}
\section{Conditions de finitude}
\section{Applications rationnelles}
\section{Les schémas de Chevalley}
\section{Compléments sur les faisceaux quasi-cohérents}
\section{Schémas formels}
\chapter{Étude globale élémentaire de quelques classes de morphismes}
\ChapterTOC
Les diverses classes de morphismes étudiées dans ce chapitre le sont
sans faire grand usage des méthodes cohomologiques; une étude plus
poussée, utilisant ces dernières méthodes, en sera faite au chapitre
III, où on utilisera surtout les §§ 2, 4 et 5 du chapitre II. Le § 8
peut être omis en première lecture: il donne quelques compléments au
formalisme développé dans les §§ i à 3, se réduisant à des applications
faciles de ce formalisme, et nous en ferons un usage moins constant
que des autres résultats de ce chapitre.
\section{Morphismes affines}
La plupart des résultats de ce paragraphe sont les contreparties «globales»
de ceux du chapitre I\ier, § 1; ils ne sont donc pas essentiellement
nouveaux et fournissent simplement un langage commode pour la suite.
\subsection{$S$-préschémas et $\mathscr{O}_S$-Algèbres}
\numberedpara Soient $S$ un préschéma, $X$ un $S$-préschéma, $f:X\to S$
son morphisme structural. On sait (\textbf{0}, 4.2.4) que l'image directe
$f_*(\mathscr{O}_X)$ est une $\mathscr{O}_S$-Algèbre, que noterons
$\mathscr{A}(X)$ lorsqu'il n'en résultera pas de confusion; si $U$ est
un ouvert de $S$, on a
\[\mathscr{A}(f^{-1}(U))=\mathscr{A}(X)\vert U.\]
\section{Spectres premiers homogènes}
\section{Spectre homogène d'un faisceau d'algèbres graduées}
\section{Fibres projectifs. Faisceaux amples}
\section{Morphismes quasi-affines; morphismes quasi-projectifs; morphismes propres; morphismes projectifs}
\section{Morphismes entiers et morphismes finis}
\section{Critères valuatifs}
\section{Schémas éclatés; cônes projetants; fermeture projective}
\end{document}
```
### Class file:
```
\ProvidesClass{EGAstyle}
%%% Document Class %%%
\LoadClass[a4paper,twoside,12pt]{report}
%%% Layout and Formatting %%%
\RequirePackage[hcentering,headsep=2ex,headheight=13.6pt,footskip=20pt,bottom=23ex,includefoot,heightrounded]{geometry}
\RequirePackage{titlesec} % section heading customization
\RequirePackage{titletoc} % TOC customization
\RequirePackage{fancyhdr} % headers and footers
\RequirePackage{enumitem} % list customization
%%% Math %%%
\RequirePackage[
leqno % equation numbers on left
]{mathtools}
\RequirePackage{amsthm}
\RequirePackage{thmtools}
%%% Fonts %%%
\RequirePackage[
osf % old style numbers in text
]{Baskervaldx} % text font
\RequirePackage[
frenchmath, % upright capital Roman and capital/lowercase Greek letters in math
baskervaldx, % baskervaldx lowercase letters in math
]{newtxmath} % math font
\RequirePackage[scr=boondox]{mathalpha} % \mathscr font
%%% French conventions %%%
\RequirePackage[french]{babel}
\frenchsetup{
og=«,fg=», % proper spacing with « and »
}
\RequirePackage[
babel=true % allows French-specific microtypographical improvements
]{microtype} % microtypography, plus letterspacing with \textls
%%% Section Headings %%%
\DeclareRobustCommand\test@chap@diff[1]{\ifnum#1=\value{chapter}\relax\else\textbf{\thechapter}, \fi}
%% new section type for numbered paragraphs (with subsubsection numbering)
\titleclass{\newpara}{straight}[\subsection]
\newcounter{newpara}
\renewcommand\thenewpara{\test@chap@diff{\arabic{chapter}}\thesubsection.\arabic{newpara}}
\titleformat{\newpara}
[runin] % shape
{\bfseries} % title and label format
{(\thenewpara)} % label
{1ex} % sep
{} % before title code
\titlespacing{\newpara}{\parindent}{0pt}{1ex}
\titlecontents{newpara}{}{}{}{} % should never appear in TOC but get errors without this
\newcommand{\numberedpara}{\newpara{}} % the main command we'll actually use
\setcounter{secnumdepth}{4} % allows numbering for \newpara
%% chapter formatting
\titleformat{\chapter}
[display] % shape
{\filcenter} % title and label format
{\Large\MakeUppercase{\chaptername}~\thechapter} % label
{4ex} % sep
{\LARGE\bfseries\MakeUppercase} % before title code
\titlespacing*{\chapter}{0pt}{40pt}{20pt}
%% section formatting
\renewcommand{\thesection}{\arabic{section}}
\titleformat{\section}
{\filcenter} % title and label format
{§\;\bfseries\thesection.} % label
{1ex} % sep
{\bfseries\MakeUppercase} % before title code
\titlespacing*{\section}{0pt}{5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
%% subsection formatting
\newcommand{\periodafter}[1]{#1.}
\titleformat{\subsection}
{\normalsize\bfseries} % title and label format
{\thesubsection.} % label
{1ex} % sep
{\periodafter} % before title code
[\setcounter{newpara}{0}] % reset paranum counter
%%% Header and Footer %%%
\renewcommand{\headrulewidth}{0pt} % remove head rule
\fancypagestyle{plain}{% redefine pagestyle for chapter pages
\fancyhf{}
\fancyfoot[LE,RO]{\footnotesize\itshape \thepage}
}
\fancyhf{} % clear existing header/footer
%% header
\fancyhead[LE,RO]{\footnotesize \thepage} % upper page numbering, alternate side even/odd
\fancyhead[RE]{\footnotesize Chap. \thechapter} % chapter number for even pages
\fancyhead[CE]{\small\scshape \textls[200]{a. grothendieck}} % author name for even pages
\fancyhead[LO]{\footnotesize §\;\thesection} % section number for odd pages
\fancyhead[CO]{\small\scshape éléments de géométrie algébrique} % book title for odd pages
%% footer
\fancyfoot[LE,RO]{\footnotesize\itshape \thepage} % lower page numbering, alternate side even/odd
\pagestyle{fancy} % actually set the page style
%%% Partial TOC's %%%
\titlecontents{locsection}
[1.9em]
{\hangindent0.6em}
{\contentslabel[§\;\hfill\thecontentslabel.]{1.9em}\enspace}
{\hspace*{-1.9em}}
{.}
\newcommand{\ChapterTOC}{%
\vspace*{-4ex}
\begin{center}
\rule{8em}{1pt} \\[4ex]
\textbf{Sommaire}
\end{center}
\startcontents[chapters]
\printcontents[chapters]{loc}{1}[1]{}
\vspace*{\baselineskip}
}
%%% Other Global Settings %%%
\setlength{\parindent}{4.5ex} % bigger paragraph indent than default
\renewcommand{\theequation}{\test@chap@diff{\arabic{chapter}}\thenewpara.\arabic{equation}} % equation numbers follow newpara counter
\newtagform{bold}[\bfseries]{\bfseries(}{)} % bold equation numbers
\usetagform{bold}
% set default enumerate style to that of EGA
\setlist[enumerate,1]{label=\textup{(\roman*)},align=left,itemsep=0pt,left=\parindent .. 0pt,itemindent=2\parindent}
%%% Theorems %%%
% in EGA, the theorems and paragraphs use the same numbering
\declaretheoremstyle[
headfont=\itshape,
bodyfont=\itshape,
headindent=\parindent,
headformat={\NAME~\textbf{\textup{(\NUMBER)}}},
headpunct={. --- }
]{EGAthmstyle}
\declaretheorem[sharenumber=newpara,style=EGAthmstyle]{corollaire}
\declaretheorem[sharenumber=newpara,style=EGAthmstyle,name=Définition]{definition}
\declaretheorem[sharenumber=newpara,style=EGAthmstyle]{lemme}
\declaretheorem[sharenumber=newpara,style=EGAthmstyle]{proposition}
\declaretheorem[sharenumber=newpara,style=EGAthmstyle,name=Théorème]{theoreme}
\declaretheoremstyle[
headfont=\itshape,
headindent=\parindent,
headformat={\textbf{\textup{(\NUMBER)}}~\NAME},
headpunct={. --- }
]{EGAexmplstyle}
\declaretheorem[sharenumber=newpara,style=EGAexmplstyle]{exemple}
\declaretheoremstyle[
headfont=\itshape,
bodyfont=\normalfont,
headindent=\parindent,
headformat={\NAME~\textbf{\textup{(\NUMBER)}}},
headpunct={. --- }
]{EGArmkstyle}
\declaretheorem[sharenumber=newpara,style=EGArmkstyle]{remarque}
%%% Common math expressions in EGA %%%
\newcommand{\boldK}{\textit{\textbf{\textsc{\large k}}}\mkern1mu}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Spec}{Spec}
\DeclareMathOperator{\resfield}{\textbf{\textit{k}}}
%%% footnotes in parentheses
\NewCommandCopy{\oldfootnote}{\footnote}
\RenewDocumentCommand{\footnote}{ o +m }{(\hspace*{-.1em}\IfValueTF{#1}{\oldfootnote[#1]{#2}}{\oldfootnote{#2}})}
\renewcommand*{\insertfootnotemarkFB}{%
\parindent=\parindentFFN
\rule\z@\footnotesep
\setbox\@tempboxa\hbox{\@thefnmark}%
\ifdim\wd\@tempboxa>\z@
\llap{(\hspace*{.05em}\textsuperscript{\@thefnmark})}\kernFFN
\fi}
\renewcommand\footnoterule{\kern-3pt \hrule width 1in \kern 2.6pt} % shorten footnote rule
```
| 3 | https://tex.stackexchange.com/users/208544 | 684570 | 317,591 |
https://tex.stackexchange.com/questions/646387 | 0 | I want to submit an manuscript to an journal that provides a template there: [https://www.frontiersin.org/about/author-guideline](https://www.frontiersin.org/about/author-guidelines) however is does seem to accept easily subfigures. The error disappears if I select elsarticle format (by removing th comment on the first line) and unselect the FrontiersinHarvard format (by commenting out the second line) What should I do?
```
%\documentclass[review]{elsarticle}
\documentclass[utf8]{FrontiersinHarvard} % for articles in journals using the Harvard Referencing Style (Author-Date), for Frontiers Reference Styles by Journal: https://zendesk.frontiersin.org/hc/en-us/articles/360017860337-Frontiers-Reference-Styles-by-Journal
\usepackage{caption}
\usepackage{url,caption, graphicx}
\usepackage{geometry}
\usepackage{subcaption}
\usepackage{float}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
bottom=20mm
}
\begin{document}
\begin{figure}[H]
\centering
\begin{subfigure}[b]{0.30\linewidth}
\centering
\includegraphics[width=0.25\textwidth]{example-image-a}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.30\linewidth}
\centering
\includegraphics[width=0.25\textwidth]{example-image-b}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.30\linewidth}
\centering
\includegraphics[width=0.25\textwidth]{example-image-c}
\end{subfigure}
\end{figure}
\end{document}
```
| https://tex.stackexchange.com/users/170562 | `! LaTeX Error: Not in outer par mode` only when using FrontiersinHarvard style | false | Here is the code provided in the Frontiers template:
```
\setcounter{figure}{2}
\setcounter{subfigure}{0}
\begin{subfigure}
\setcounter{figure}{2}
\setcounter{subfigure}{0}
\centering
\begin{minipage}[b]{0.5\textwidth}
\includegraphics[width=\linewidth]{logo1.eps}
\caption{This is Subfigure 1.}
\label{fig:Subfigure 1}
\end{minipage}
\setcounter{figure}{2}
\setcounter{subfigure}{1}
\begin{minipage}[b]{0.5\textwidth}
\includegraphics[width=\linewidth]{logo2.eps}
\caption{This is Subfigure 2.}
\label{fig:Subfigure 2}
\end{minipage}
\setcounter{figure}{2}
\setcounter{subfigure}{-1}
\caption{Enter the caption for your subfigure here. \textbf{(A)} This is the caption for Subfigure 1. \textbf{(B)} This is the caption for Subfigure 2.}
\label{fig: subfigures}
\end{subfigure}
```
| 0 | https://tex.stackexchange.com/users/296197 | 684572 | 317,592 |
https://tex.stackexchange.com/questions/684538 | 2 | Let's say I have some latex template (using the default `beamer` style here). This template is defining some specific symbol for the `\item`s in the `itemize` environments. Is it possible to use the *same* symbol without using an `itemize` environment?
I'd like this to work independently of the concrete symbol that is being used. For instance `beamer` uses some kind of triangular arrow symbol, while the default `article` uses a bullet point. I'd like to be able to extract the currently used symbol no matter what it is.
E.g.
```
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize}
\item Item with symbol.
\end{itemize}
I want to use item symbol again here: SYMBOLHERE
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/38199 | How to use current \item symbol outside of \itemize list? | true | **Short answer**
For `beamer` you can access the symbol with `\usebeamertemplate{itemize item}`.
**Long answer**
There is no answer which holds for *any* class. Most standard classes define the macros `\labelitemi`,..., `\labelitemiv`. For example
```
% article.cls ll 533--358
\newcommand\labelitemi {\labelitemfont \textbullet}
\newcommand\labelitemii {\labelitemfont \bfseries \textendash}
\newcommand\labelitemiii{\labelitemfont \textasteriskcentered}
\newcommand\labelitemiv {\labelitemfont \textperiodcentered}
```
or
```
% scrartcl.cls ll. 6755--6758
\newcommand*\labelitemi{\usekomafont{labelitemi}{\textbullet}}
\newcommand*\labelitemii{\usekomafont{labelitemii}{\textendash}}
\newcommand*\labelitemiii{\usekomafont{labelitemiii}{\textasteriskcentered}}
\newcommand*\labelitemiv{\usekomafont{labelitemiv}{\textperiodcentered}}
```
or
```
% memoir.cls ll. 4711--4714
\newcommand{\labelitemi}{\textbullet}
\newcommand{\labelitemii}{\normalfont\bfseries \textendash}
\newcommand{\labelitemiii}{\textasteriskcentered}
\newcommand{\labelitemiv}{\textperiodcentered}
```
When you start an `{itemize}` environment, the current counter depth is converted to a lowercase roman numeral (from `i` to `iv`) and the corresponding `\labelitem...` macro is used as label for the list. With all these classes you can thus use `\labelitem...` in your document (thought it might be better to add a group around it, lest the font change commands do things you don't want).
`beamer`, however, does things somewhat differently: the counter depth is converted into a string (empty, or `sub`, or `subsub`), and then the corresponding beamer template `itemize XXitem` is used. Therefore you find
```
% beamerinnerthemedefault.sty ll. 173--175
\defbeamertemplate*{itemize item}{default}{\usebeamerfont*{itemize item}\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}
\defbeamertemplate*{itemize subitem}{default}{\usebeamerfont*{itemize subitem}\raise1.5pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}
\defbeamertemplate*{itemize subsubitem}{default}{\usebeamerfont*{itemize subsubitem}\raise1.5pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}
```
A possible workaround is to write in your preamble the following lines:
```
\providecommand*{\labelitemi}{\leavevmode\usebeamertemplate{itemize item}}
\providecommand*{\labelitemii}{\leavevmode\usebeamertemplate{itemize subitem}}
\providecommand*{\labelitemiii}{\leavevmode\usebeamertemplate{itemize subsubitem}}
```
In this way, when using standard classes (in broad sense, i.e. also `memoir` and KoMa classes) the `\provdecommand*` will be simply ignored, while using `beamer` it will give the desired output.
| 4 | https://tex.stackexchange.com/users/82917 | 684573 | 317,593 |
https://tex.stackexchange.com/questions/684569 | 1 | I have several examples (using the theorem environent in amsmath) that must continue along the text and I would like to referece them by "example number" + "name given the fist time". For instance:
Example 1 (Example name)
Some more discussion
Continuance of Example 1 (Example name) ...
I found [here](https://tex.stackexchange.com/questions/68830/continuance-of-environment?rq=1) how to implement the fist part (code below), which reference by "example number" but I don't know how to recover the example name.
```
\documentclass{book}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{example}[theorem]{Example}
\newtheorem*{continuancex}{Continuance of Example \continuanceref}
\newenvironment{continuance}[1]
{\newcommand\continuanceref{\ref{#1}}\continuancex}{\endcontinuancex}
\begin{document}
\chapter{Title}
\begin{example} \label{ex1}
This is an example.
\end{example}
Some text stands here. And then there is some space between this and the continued example.
Further should the continued example not be intended but start at the beginning of the line.
\begin{continuance}{ex1}
This is the continued example.
\end{continuance}
Some more text, which should follow after a little vertical space.
\end{document}
```
| https://tex.stackexchange.com/users/189945 | continue example repeating the title given the first time | true | You can use [`\getnamereftext`](https://tex.stackexchange.com/a/530404/4427) and, of course, `nameref` (automatically loaded by `hyperref`).
```
\documentclass{book}
\usepackage{amsthm}
\usepackage{nameref}% or hyperref
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{example}[theorem]{Example}
\newtheorem*{continuancex}{Continuance of Example \continuanceref}
\makeatletter
\newcommand{\getnamereftext}[1]{%
\@ifundefined{r@#1}{}{%
\unexpanded\expandafter\expandafter\expandafter{%
\expandafter\expandafter\expandafter\@thirdoffive\csname r@#1\endcsname
}%
}%
}
\makeatletter
\newenvironment{continuance}[1]{%
\newcommand\continuanceref{\ref{#1}}%
\if\relax\getnamereftext{#1}\relax
\continuancex
\else
\continuancex[\nameref{#1}]%
\fi
}{\endcontinuancex}
\begin{document}
\chapter{Title}
\begin{example}\label{ex0}
This example has no title
\end{example}
Some text in between
\begin{continuance}{ex0}
Something else
\end{continuance}
\begin{example}[Description] \label{ex1}
This is an example.
\end{example}
Some text stands here. And then there is some space between this and the continued example.
Further should the continued example not be intended but start at the beginning of the line.
\begin{continuance}{ex1}
This is the continued example.
\end{continuance}
Some more text, which should follow after a little vertical space.
\end{document}
```
With no `\expandafter` and friends:
```
\documentclass{book}
\usepackage{amsthm}
\usepackage{nameref}% or hyperref
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{example}[theorem]{Example}
\newtheorem*{continuancex}{Continuance of Example \continuanceref}
\newcommand{\continuanceref}{}
\ExplSyntaxOn
\NewExpandableDocumentCommand{\getnamereftext}{m}
{
\tl_if_exist:cT { r@#1 }% check whether \ref is known
{% in this case extract the third item
\tl_item:cn { r@#1 } { 3 }
}
}
\NewDocumentEnvironment{continuance}{m}
{
\renewcommand\continuanceref{\ref{#1}}%
\tl_if_blank:eTF { \getnamereftext{#1} }
{ \continuancex }
{ \continuancex[\nameref{#1}] }
}
{\endcontinuancex}
\ExplSyntaxOff
\begin{document}
\chapter{Title}
\begin{example}\label{ex0}
This example has no title
\end{example}
Some text in between
\begin{continuance}{ex0}
Something else
\end{continuance}
\begin{example}[Description] \label{ex1}
This is an example.
\end{example}
Some text stands here. And then there is some space between this and the continued example.
Further should the continued example not be intended but start at the beginning of the line.
\begin{continuance}{ex1}
This is the continued example.
\end{continuance}
Some more text, which should follow after a little vertical space.
\end{document}
```
| 2 | https://tex.stackexchange.com/users/4427 | 684574 | 317,594 |
https://tex.stackexchange.com/questions/684371 | 0 | I have a `main.bib` file called that I am trying to incorporate into an `amsart` document. I orginally had
```
\bibliographystyle{plain}
\bibliography{main}
```
but I wanted to switch `plain` to `amsplain`. I was under the impression that `amsplain` gives square brackets for bibliography items, but it gave me numbered (1., 2., etc.) instead. Are the default settings for it to be in square brackets? How can I change the nunbering to square brackets? I can't post my code right now as the document is personal, but I will try to make a MWE in another file. In any case, I'm happy with how the rest of `amsplain` format looks, so I really just want a way to change to square brackets.
EDIT: I played around with the code. It seems that using `article` gives the correct output for `amsplain` but if you use `amsmath`, everything is identical except [1] becomes 1. (e.g.). I would have thought that `amsmath` and `amsplain` together would give the desired output, but apparently not. I've seen papers submitted to AMS journals with the desired formatting of both `amsart` and `amsplain` so this should be possible. Any idea how to give square brackets when loading both `amsart` and `amsplain`?
| https://tex.stackexchange.com/users/193871 | What are the default numbering settings for the amsplain bibliography style (bibtex)? | false | `amsart` defines the default label style for bibliographies thus:
```
\def\@defaultbiblabelstyle#1{#1.}
```
I haven't checked `amsplain.bst` to see if it overrides this, but I suspect it may not. Therefore, if you put this in your preamble, it should add the brackets you are expecting:
```
\makeatletter
\def\@defaultbiblabelstyle#1{[#1]}
\makeatother
```
Not tested.
| 4 | https://tex.stackexchange.com/users/579 | 684591 | 317,601 |
https://tex.stackexchange.com/questions/684371 | 0 | I have a `main.bib` file called that I am trying to incorporate into an `amsart` document. I orginally had
```
\bibliographystyle{plain}
\bibliography{main}
```
but I wanted to switch `plain` to `amsplain`. I was under the impression that `amsplain` gives square brackets for bibliography items, but it gave me numbered (1., 2., etc.) instead. Are the default settings for it to be in square brackets? How can I change the nunbering to square brackets? I can't post my code right now as the document is personal, but I will try to make a MWE in another file. In any case, I'm happy with how the rest of `amsplain` format looks, so I really just want a way to change to square brackets.
EDIT: I played around with the code. It seems that using `article` gives the correct output for `amsplain` but if you use `amsmath`, everything is identical except [1] becomes 1. (e.g.). I would have thought that `amsmath` and `amsplain` together would give the desired output, but apparently not. I've seen papers submitted to AMS journals with the desired formatting of both `amsart` and `amsplain` so this should be possible. Any idea how to give square brackets when loading both `amsart` and `amsplain`?
| https://tex.stackexchange.com/users/193871 | What are the default numbering settings for the amsplain bibliography style (bibtex)? | true | Using `amsref` will give you square brackets, cf. <http://mirrors.ctan.org/info/amscls-doc/Author_Handbook_Journals.pdf>:
```
\documentclass{amsart}
\usepackage{amsrefs}
\begin{document}
Alan Sokal~\cite{Sokal96} recommends Bourbaki’s
text~\cite{Bourbaki70} for a gentle introduction to set theory.
\bibliography{nonsense}
\end{document}
```
The `amsplain` output -- for comparison -- looks like this:
| 1 | https://tex.stackexchange.com/users/29873 | 684592 | 317,602 |
https://tex.stackexchange.com/questions/684476 | 0 | **CONTEXT |** Bilingual document, Polyglossia in the preamble: Arabic=main, French=secondary (mostly for math). Used \textfrench to render page numbering and theorem numbering with the same font used in math content:
```
\newtheorem{defn}{تعريف}
\renewcommand{\thedefn}{\textfrench{\arabic{defn}}}
```
...
```
\pagestyle{fancy}
\fancyhf{}
\lhead{\textfrench{\thepage}}
```
**ISSUE |** Couldn't figure how to apply that \textfrench to item numbers inside lists.
**EDIT |** I just want to have the same font for all numbers either in the French content (math) or the Arabic one (text). Already did it for theorem numbers and page numbers with the help of the \textfrench command, as shown in the piece of code. Still looking for achieving the same thing for item numbers inside lists: where do I need to apply that \textfrench command to do that?
| https://tex.stackexchange.com/users/296021 | Applying \textfrench to item numbering inside lists written in Arabic | true |
>
> \renewcommand{\theenumi}{\textfrench{\arabic{enumi}}}
>
>
>
| 1 | https://tex.stackexchange.com/users/296021 | 684608 | 317,608 |
https://tex.stackexchange.com/questions/684618 | 0 | I currently use overleaf online.
I suddenly meet this problem.
I did not change anything from the bib file....
It worked fine yesterday.
I am not sure if this is the problem with bibliographystyle.
I have searched this issue online, and I saw many people encountered this problem and unsolved.
Could you please help me solve this problem?
Thank you for all
Best wishes
`\bibliographystyle{elsarticle-harv} \nocite{*} \bibliography{Lil2}`
| https://tex.stackexchange.com/users/279381 | I couldn't open database file Lil2.bib : \bibdata{Lil2 : } | true | I found that this problem only exists in this specific project. This bug appeared suddenly. The document did not change any settings about the bibliography before the bug appeared.
This is an online co-work project. I checked a lot of information, and I really couldn't solve this problem, so I sent a message to my supervisor. Strangely, It works totally fine on my supervisor's computer. My supervisor copied the same project, and share the new link of the copied project with me. It works fine on my computer now......
No one changed any code in this document in the process.
If you are in the same situation as me, please don't be anxious, **try to get your co-worker to copy the project and send you a new link.**
Unfortunately, I am not a computer professional. I don't know what is causing this problem. Hope someone can answer in the future.
I list below what I have tried while trying to solve this problem. Sadly, none of these methods worked:
1. change a browser: I change Chrome to edge/ edge dev, not work.
2. Copy the file myself: After I encounter this issue, I copied myself again. the new copy file not works. But the previously copied file works fine. This means after you have the problem already, copying the project won't fix the bug.
3. recompile from scratch
4. re-name the bib/create a new bib: the warning will disappear, but the document still won't load your reference
| 1 | https://tex.stackexchange.com/users/279381 | 684620 | 317,610 |
https://tex.stackexchange.com/questions/684609 | 2 | For annotating documents, I've defined a command like so:
```
\DeclareDocumentCommand \commment { o m } {%
\stepcounter{commentcounter}
\ifhidecomments
\else \IfNoValueTF{#1}{%
\textsf{\textcolor{Red}{\footnotesize[Comment:\;#2]}}%
}{%
\textsf{\textcolor{lightgray}{\footnotesize[Comment:\;#2]}}%
}%
\fi
}
```
In the text you can embed a comment by doing `\comment{blah blah blah}` and it will render like `[Comment: blah blah blah]` in the text, but in red. If you want the comment to render but in gray instead (to keep it around but indicate it's been addressed), you can do `\comment[]{blah blah blah}`, i.e. pass an empty optional argument.
Now, what I want is to be able to hide all comments *without a trace* with a single command (as opposed to manually removing them). I have an if-else statement in my DocumentCommand that doesn't render the comment if `\hidecommentstrue` is specified in the document. When I used that command, indeed all the comments are hidden. Unfortunately, it can mess with the spacing between words. For instance, if I have `word1 \comment{blah} word1` and I do `\hidecommentstrue`, there's extra space between `word1` and `word2` that is not there if I actually remove the `\comment`.
Is there something I can add to my command that would fix this? Or is there no way around removing the comments manually?
Here is a minimum working example:
```
\documentclass{article}
\usepackage{lipsum}
\usepackage[dvipsnames]{xcolor}
\usepackage{totcount}
\newif\ifhidecomments
\newtotcounter{commentcounter}
\setcounter{commentcounter}{0}
\DeclareDocumentCommand \comment { o m } {%
\stepcounter{commentcounter}
\ifhidecomments
\else \IfNoValueTF{#1}{%
\textsf{\textcolor{Red}{\footnotesize[Comment:\;#2]}}%
}{%
\textsf{\textcolor{lightgray}{\footnotesize[Comment:\;#2]}}%
}%
\fi
}
% \hidecommentstrue
\begin{document}
\lipsum[1]
\comment{this is a comment}
\lipsum[1]
\end{document}
```
| https://tex.stackexchange.com/users/154405 | How to hide custom commands without leaving space behind? | true | The problem is a kind of: [unexpected space because of not commented end-of-line](https://tex.stackexchange.com/questions/7453). you can fix it either using one more percent and `\ignorespaces`:
```
\documentclass{article}
\usepackage{lipsum}
\usepackage[dvipsnames]{xcolor}
\usepackage{totcount}
\newif\ifhidecomments
\newtotcounter{commentcounter}
\setcounter{commentcounter}{0}
\DeclareDocumentCommand \comment { o m } {%
\stepcounter{commentcounter}% <-- percent needed!
\ifhidecomments
\ignorespaces
\else
\IfNoValueTF{#1}{%
\textsf{\textcolor{Red}{\footnotesize[Comment:\;#2]}}%
}{%
\textsf{\textcolor{lightgray}{\footnotesize[Comment:\;#2]}}%
}%
\fi
}
\begin{document}
\lipsum[1]
\comment{this is a comment}
\lipsum[1]
\hidecommentstrue
\lipsum[1]
\comment{this is a comment}
\lipsum[1]
\end{document}
```
or two more percent and one space:
```
\documentclass{article}
\usepackage{lipsum}
\usepackage[dvipsnames]{xcolor}
\usepackage{totcount}
\newif\ifhidecomments
\newtotcounter{commentcounter}
\setcounter{commentcounter}{0}
\DeclareDocumentCommand \comment { o m } {%
\stepcounter{commentcounter}% <-- percent needed!
\ifhidecomments
\else
\IfNoValueTF{#1}{%
\textsf{\textcolor{Red}{\footnotesize[Comment:\;#2]}}%
}{%
\textsf{\textcolor{lightgray}{\footnotesize[Comment:\;#2]}}%
} % <-- space before percent added
\fi
}
\begin{document}
\lipsum[1]
\comment{this is a comment}%
\lipsum[1]
\hidecommentstrue
\lipsum[1]
\comment{this is a comment}%
\lipsum[1]
\end{document}
```
BTW: With the shown definition, if would IMHO make more sense to define, a `\comment` with star variant, e.g.,
```
\DeclareDocumentCommand \comment { s m } {%
\stepcounter{commentcounter}% <-- percent needed!
\ifhidecomments
\else
\IfBooleanTF{#1}{%
\textsf{\textcolor{lightgray}{\footnotesize[Comment:\;#2]}}%
}{%
\textsf{\textcolor{Red}{\footnotesize[Comment:\;#2]}}%
} % <-- space before percent added
\fi
}
```
instead of using testing for an empty optional argument.
| 1 | https://tex.stackexchange.com/users/277964 | 684621 | 317,611 |
https://tex.stackexchange.com/questions/684622 | 2 |
```
\documentclass[12pt, a4paper]{article}
%\pagestyle{plain}
%\usepackage[top=0.7 in,bottom=0.5 in,left=0.6 in,right=0.6 in]{geometry}
%\usepackage[parfill]{parskip}
%\setlength\parindent{0pt} % Removes all indentation from paragraphs
%\renewcommand{\baselinestretch}{1.10} %line spacing
\usepackage{enumitem}
%\usepackage{parskip}
\begin{document}
%\setlist[enumerate]{label={\arabic*.}}
\begin{enumerate}[label={\arabic*.}]
\item blah 1 222dfhkvnuittvriebvnytbyrteoy marcus polo texas polo fg polo polo marco bolo marco bolo marco bolo marco bolo
\item blah 2
\end{enumerate}
\end{document}
```
This gives
1. blah 1 222dfhkvnuittvriebvnytbyrteoy marcus polo texas polo fg polo polo marco bolo marco bolo marco bolo marco bolo.
2. blah 2
However intend to start the second line of each item from below the item number. Secondly how to adjust space between item number and start of the item
| https://tex.stackexchange.com/users/296233 | customising second line indent | false |
>
> However intend to start the second line of each item from below the item number.
>
>
>
Maybe this link helps. <https://tex.stackexchange.com/a/680058/278534>
>
> Secondly how to adjust space between item number and start of the item
>
>
>
Use `labelsep=` locally at the start of the list structure environment or globally within `\setlist`. For `\setlist` see section 5 of the `enumitem <https://mirrors.mit.edu/CTAN/macros/latex/contrib/enumitem/enumitem.pdf>
For example, you could use `\setlist[enumerate]{labelsep=2em}` in the preamble after loading the `enumitem` package or, in the document body, `\begin{enumerate}[labelsep=2em]`.
```
\documentclass[12pt, a4paper]{article}
%\pagestyle{plain}
%\usepackage[top=0.7 in,bottom=0.5 in,left=0.6 in,right=0.6 in]{geometry}
%\usepackage[parfill]{parskip}
%\setlength\parindent{0pt} % Removes all indentation from paragraphs
%\renewcommand{\baselinestretch}{1.10} %line spacing
\usepackage{enumitem}
\setlist[enumerate]{labelsep=2em}
%\usepackage{parskip}
\begin{document}
%\setlist[enumerate]{label={\arabic*.}}
\begin{enumerate}[label={\arabic*.},labelsep=2em]
\item blah 1 222dfhkvnuittvriebvnytbyrteoy marcus polo texas polo fg polo polo marco bolo marco bolo marco bolo marco bolo
\item blah 2
\end{enumerate}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/278534 | 684623 | 317,612 |
https://tex.stackexchange.com/questions/684602 | 1 | I am using MikTex on a Windows 10 work machine to produce work documents.
It worked fine until I tried to install package hyperref. I found I couldn't install any packages, presumably because of some firewall blockage.
I tried to set up a local repository, but that got blocked too, with a "timeout reached, error 28" message.
I tried to select a different net repository, but the list it offered me was empty, and it did not allow me to enter the URL of a repository.
I tried various other things through the MikTex console with no results - often getting the "timeout reached" error..
So then I followed a suggestion to do a full MikTex installation, so that it would not ever need to request packages. I followed the instructions and downloaded the Net Installer from the MikTex site. But that got blocked as well, presumably at the stage when it tried to connect to a mirror and download all the packages.
I can connect to mirror sites in a browser and manually download from them, but attempts by MikTex to do that fail.
It looks like what I need is a downloadable installer that, once downloaded, doesn't need to download anything else - so a full 4GB-ish file containing all packages (the Net Installer file is only 100-something MB), or else a way to manually download all the packages to a dir and tell MikTex to use them. For the latter approach, I couldn't see a way to download all packages, at the mirror I looked at. Further, I can't see any way to tell MikTex to just get packages from an ordinary directory on the local machine. It seems to insist on getting them from a dir that it has set up as a repository, and attempts to do that get blocked, presumably because they involve it trying to connect to a net mirror.
Can anybody help me solve this problem?
Thank you very much.
| https://tex.stackexchange.com/users/165583 | Full MikTex install blocked on work machine - getting around that | false | Use the portable MiKTeX version. I'm working since many years with that on an enterprise Windows 10 machine, that is completely secured and locked. Details are under miktex.org/download -> Portable Edition.
| 1 | https://tex.stackexchange.com/users/121733 | 684624 | 317,613 |
https://tex.stackexchange.com/questions/188034 | 7 | I want an enumeration list. The list should however be fixed at its position. Furthermore at all time only 1 item should shown. So what I want is sort of this
```
\documentclass{beamer}
\begin{document}
\begin{frame}{Test}
\only<1>{%
\begin{enumerate}
\item[1.]<1> Item 1
\end{enumerate}
}
\only<2>{%
\begin{enumerate}
\item[2.]<2> Item 2
\end{enumerate}
}
\only<3>{%
\begin{enumerate}
\item[3.]<3> Item 3
\end{enumerate}
}
\end{frame}
\end{document}
```
Can this be achieved in an easy manner? For example, is there an option? Such that you could just use
```
\documentclass{beamer}
\begin{document}
\begin{frame}{Test}
\begin{enumerate}
\item<1> Item 1
\item<2> Item 2
\item<3> Item 3
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/15360 | Beamer enumeration, continue counting but keep item at fixed position | true | You could pass `<only@+>` as default action to the enumerate environment to automatically show one item at a time:
```
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{enumerate}[<only@+>]
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}
\end{frame}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/36296 | 684634 | 317,616 |
https://tex.stackexchange.com/questions/684633 | 4 | I want to draw a horizontal line on a word in LaTeX. I've tried \cancel but it draws a diagonal line. I checked the \cancel documentation and couldn't find anything about drawing a horizontal line.
| https://tex.stackexchange.com/users/296244 | How to draw a horizontal line on a word in LaTeX | true | Yes it is possible using the package `soul` with the command `\st`.
```
\documentclass[a4paper,12pt]{article}
\usepackage{soul}
\begin{document}
\st{Today not is a good morning}
\end{document}
```
| 6 | https://tex.stackexchange.com/users/117876 | 684635 | 317,617 |
https://tex.stackexchange.com/questions/684633 | 4 | I want to draw a horizontal line on a word in LaTeX. I've tried \cancel but it draws a diagonal line. I checked the \cancel documentation and couldn't find anything about drawing a horizontal line.
| https://tex.stackexchange.com/users/296244 | How to draw a horizontal line on a word in LaTeX | false | If you can compile with lualatex, I suggest to use the `lua-ul` package. It overcomes many of the limitations of similar packages like `ulem` or `soul` (problems with some unicode content etc.).
```
% !TeX TS-program = lualatex
\documentclass{article}
\usepackage{lua-ul}
\begin{document}
text \strikeThrough{text} text
\end{document}
```
| 6 | https://tex.stackexchange.com/users/36296 | 684637 | 317,618 |
https://tex.stackexchange.com/questions/684632 | 1 | I need to enlarge this table until it touches the right and left side of the A4 page. In a nutshell I should remove the margins on the sides. It's my first time using latex and I've tried several attempts, but none of them work. I'm pretty sure I'm setting some package wrong
This is the code.
What should I change?
```
\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry} % set page parameters appropriately
\usepackage{longtable}
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage{dcolumn} % align numbers in columns on decimal markers
\newcolumntype{d}[1]{D..{#1}}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\begingroup % localize scope of next four instructions
\small % 10% linear reduction in font size
\setlength\tabcolsep{0pt} % let LaTeX figure out inter-column space
\setlength\LTleft{0pt} % see p. 7 of package's user guide
\setlength\LTright{0pt}
\begin{longtable}{@{\extracolsep{\fill}} l *{7}{d{2.5}} d{2.6} @{}}
%% headers and footers
\caption{X} \label{tab:x} \\
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endfirsthead
\multicolumn{9}{@{}l}{Table \thetable, continued}\\
\addlinespace
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endhead
\midrule
\multicolumn{9}{r@{}}{\footnotesize (continued on next page)}\\
\endfoot
% empty final footer
\endlastfoot
%% body of table
sex & 0.226^{***} & 0.219^{***} & 0.239^{***} & 0.244^{***} & 0.131^{***} & 0.132^{***} & 0.132^{***} & 0.142^{***} \\
& (0.020) & (0.019) & (0.017) & (0.017) & (0.016) & (0.016) & (0.016) & (0.016) \\
\addlinespace
eta & & -0.009^{***} & -0.005^{***} & -0.004^{***} & -0.002^{**} & -0.002^{**} & -0.002^{**} & -0.002^{*} \\
& & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
studio\_lev2 & & & 0.330^{***} & 0.163^{***} & 0.129^{***} & 0.127^{***} & 0.127^{***} & 0.129^{***} \\
& & & (0.021) & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
studio\_lev3 & & & 0.717^{***} & 0.459^{***} & 0.420^{***} & 0.417^{***} & 0.417^{***} & 0.431^{***} \\
& & & (0.035) & (0.038) & (0.036) & (0.036) & (0.036) & (0.036) \\
\addlinespace
type\_job\_Middle-class\_worker & & & & 0.219^{***} & 0.189^{***} & 0.187^{***} & 0.187^{***} & 0.191^{***} \\
& & & & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
type\_job\_Manager & & & & 0.465^{***} & 0.418^{***} & 0.414^{***} & 0.414^{***} & 0.410^{***} \\
& & & & (0.039) & (0.037) & (0.037) & (0.037) & (0.036) \\
\addlinespace
type\_job\_Self-Employed & & & & -0.142^{***} & -0.189^{***} & -0.190^{***} & -0.189^{***} & -0.173^{***} \\
& & & & (0.022) & (0.020) & (0.020) & (0.020) & (0.020) \\
\addlinespace
acontrib & & & & & 0.020^{***} & 0.020^{***} & 0.020^{***} & 0.019^{***} \\
& & & & & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
dislav & & & & & & -0.085^{***} & -0.085^{***} & -0.050^{*} \\
& & & & & & (0.027) & (0.027) & (0.027) \\
\addlinespace
occnow & & & & & & & 0.029 & 0.075 \\
& & & & & & & (0.072) & (0.073) \\
\addlinespace
ireg2 & & & & & & & & 0.147^{*} \\
& & & & & & & & (0.080) \\
\addlinespace
ireg3 & & & & & & & & -0.005 \\
& & & & & & & & (0.032) \\
\addlinespace
ireg4 & & & & & & & & -0.054 \\
& & & & & & & & (0.039) \\
\addlinespace
ireg5 & & & & & & & & -0.012 \\
& & & & & & & & (0.034) \\
\addlinespace
ireg6 & & & & & & & & 0.067 \\
& & & & & & & & (0.050) \\
\addlinespace
ireg7 & & & & & & & & -0.080^{*} \\
& & & & & & & & (0.043) \\
\addlinespace
ireg8 & & & & & & & & 0.076^{**} \\
& & & & & & & & (0.036) \\
\addlinespace
ireg9 & & & & & & & & -0.018 \\
& & & & & & & & (0.033) \\
\addlinespace
ireg10 & & & & & & & & -0.071 \\
& & & & & & & & (0.045) \\
\addlinespace
ireg11 & & & & & & & & 0.050 \\
& & & & & & & & (0.041) \\
\addlinespace
ireg12 & & & & & & & & 0.012 \\
& & & & & & & & (0.038) \\
\addlinespace
ireg13 & & & & & & & & -0.099^{*} \\
& & & & & & & & (0.060) \\
\addlinespace
ireg14 & & & & & & & & -0.217^{***} \\
& & & & & & & & (0.056) \\
\addlinespace
ireg15 & & & & & & & & -0.091^{**} \\
& & & & & & & & (0.039) \\
\addlinespace
ireg16 & & & & & & & & -0.120^{***} \\
& & & & & & & & (0.040) \\
\addlinespace
ireg17 & & & & & & & & -0.176^{***} \\
& & & & & & & & (0.054) \\
\addlinespace
ireg18 & & & & & & & & -0.019 \\
& & & & & & & & (0.046) \\
\addlinespace
ireg19 & & & & & & & & -0.126^{***} \\
& & & & & & & & (0.044) \\
\addlinespace
ireg20 & & & & & & & & -0.021 \\
& & & & & & & & (0.039) \\
\addlinespace
Constant & 6.860^{***} & 7.530^{***} & 7.133^{***} & 7.034^{***} & 6.273^{***} & 6.324^{***} & 6.266^{***} & 6.171^{***} \\
& (0.015) & (0.089) & (0.082) & (0.078) & (0.082) & (0.083) & (0.166) & (0.170) \\
\midrule
Observations & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}226} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} \\
$R^{2}$ & 0.056 & 0.081 & 0.270 & 0.358 & 0.455 & 0.457 & 0.457 & 0.476 \\
Adjusted $R^{2}$ & 0.056 & 0.080 & 0.269 & 0.356 & 0.453 & 0.455 & 0.455 & 0.469 \\
Resid.\ Std.\ Error & 0.406 & 0.400 & 0.357 & 0.335 & 0.309 & 0.309 & 0.309 & 0.305 \\
\qquad df & \mc{2227} & \mc{2226} & \mc{2224} & \mc{2218} & \mc{2164} & \mc{2163} & \mc{2162} & \mc{2143} \\
$F$-Statistic
& \mc{133.081} & \mc{97.706} & \mc{206.134} & \mc{176.461} & \mc{225.471 } & \mc{202.428} & \mc{182.131} & \mc{67.151} \\
\qquad df & \mc{1;2227} & \mc{2;2226} & \mc{4;2224} & \mc{7;2218} & \mc{8;2164} & \mc{9;2163} & \mc{10;2162} & \mc{29;2143} \\
\bottomrule
\addlinespace
\multicolumn{9}{@{}l}{\textit{Note}: $^{*}\ p<0.1$; $^{**}\ p<0.05$; $^{***}\ p<0.01$} \\
\end{longtable}
\endgroup
\end{document}
```
| https://tex.stackexchange.com/users/294399 | Remove Left and Right margin in order to get a bigger table | true | As already explained in a comment, you can set `\LTleft` and `\LTright` to `-1in` to extend the `longtable` into the left and right margin, that you've set using `margin=1in` for package `geometry`:
```
\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry} % set page parameters appropriately
\usepackage{longtable}
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage{dcolumn} % align numbers in columns on decimal markers
\newcolumntype{d}[1]{D..{#1}}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\begingroup % localize scope of next four instructions
\small % 10% linear reduction in font size
\setlength\tabcolsep{0pt} % let LaTeX figure out inter-column space
\setlength\LTleft{-1in}% extend by left margin (see geometry option margin=1in) see p. 7 of package's user guide
\setlength\LTright{-1in}% extend by rightmargin (see geometry option margin=1in)
\begin{longtable}{@{\extracolsep{\fill}} l *{7}{d{2.5}} d{2.6} @{}}
%% headers and footers
\caption{X} \label{tab:x} \\
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endfirsthead
\multicolumn{9}{@{}l}{Table \thetable, continued}\\
\addlinespace
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endhead
\midrule
\multicolumn{9}{r@{}}{\footnotesize (continued on next page)}\\
\endfoot
% empty final footer
\endlastfoot
%% body of table
sex & 0.226^{***} & 0.219^{***} & 0.239^{***} & 0.244^{***} & 0.131^{***} & 0.132^{***} & 0.132^{***} & 0.142^{***} \\
& (0.020) & (0.019) & (0.017) & (0.017) & (0.016) & (0.016) & (0.016) & (0.016) \\
\addlinespace
eta & & -0.009^{***} & -0.005^{***} & -0.004^{***} & -0.002^{**} & -0.002^{**} & -0.002^{**} & -0.002^{*} \\
& & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
studio\_lev2 & & & 0.330^{***} & 0.163^{***} & 0.129^{***} & 0.127^{***} & 0.127^{***} & 0.129^{***} \\
& & & (0.021) & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
studio\_lev3 & & & 0.717^{***} & 0.459^{***} & 0.420^{***} & 0.417^{***} & 0.417^{***} & 0.431^{***} \\
& & & (0.035) & (0.038) & (0.036) & (0.036) & (0.036) & (0.036) \\
\addlinespace
type\_job\_Middle-class\_worker & & & & 0.219^{***} & 0.189^{***} & 0.187^{***} & 0.187^{***} & 0.191^{***} \\
& & & & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
type\_job\_Manager & & & & 0.465^{***} & 0.418^{***} & 0.414^{***} & 0.414^{***} & 0.410^{***} \\
& & & & (0.039) & (0.037) & (0.037) & (0.037) & (0.036) \\
\addlinespace
type\_job\_Self-Employed & & & & -0.142^{***} & -0.189^{***} & -0.190^{***} & -0.189^{***} & -0.173^{***} \\
& & & & (0.022) & (0.020) & (0.020) & (0.020) & (0.020) \\
\addlinespace
acontrib & & & & & 0.020^{***} & 0.020^{***} & 0.020^{***} & 0.019^{***} \\
& & & & & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
dislav & & & & & & -0.085^{***} & -0.085^{***} & -0.050^{*} \\
& & & & & & (0.027) & (0.027) & (0.027) \\
\addlinespace
occnow & & & & & & & 0.029 & 0.075 \\
& & & & & & & (0.072) & (0.073) \\
\addlinespace
ireg2 & & & & & & & & 0.147^{*} \\
& & & & & & & & (0.080) \\
\addlinespace
ireg3 & & & & & & & & -0.005 \\
& & & & & & & & (0.032) \\
\addlinespace
ireg4 & & & & & & & & -0.054 \\
& & & & & & & & (0.039) \\
\addlinespace
ireg5 & & & & & & & & -0.012 \\
& & & & & & & & (0.034) \\
\addlinespace
ireg6 & & & & & & & & 0.067 \\
& & & & & & & & (0.050) \\
\addlinespace
ireg7 & & & & & & & & -0.080^{*} \\
& & & & & & & & (0.043) \\
\addlinespace
ireg8 & & & & & & & & 0.076^{**} \\
& & & & & & & & (0.036) \\
\addlinespace
ireg9 & & & & & & & & -0.018 \\
& & & & & & & & (0.033) \\
\addlinespace
ireg10 & & & & & & & & -0.071 \\
& & & & & & & & (0.045) \\
\addlinespace
ireg11 & & & & & & & & 0.050 \\
& & & & & & & & (0.041) \\
\addlinespace
ireg12 & & & & & & & & 0.012 \\
& & & & & & & & (0.038) \\
\addlinespace
ireg13 & & & & & & & & -0.099^{*} \\
& & & & & & & & (0.060) \\
\addlinespace
ireg14 & & & & & & & & -0.217^{***} \\
& & & & & & & & (0.056) \\
\addlinespace
ireg15 & & & & & & & & -0.091^{**} \\
& & & & & & & & (0.039) \\
\addlinespace
ireg16 & & & & & & & & -0.120^{***} \\
& & & & & & & & (0.040) \\
\addlinespace
ireg17 & & & & & & & & -0.176^{***} \\
& & & & & & & & (0.054) \\
\addlinespace
ireg18 & & & & & & & & -0.019 \\
& & & & & & & & (0.046) \\
\addlinespace
ireg19 & & & & & & & & -0.126^{***} \\
& & & & & & & & (0.044) \\
\addlinespace
ireg20 & & & & & & & & -0.021 \\
& & & & & & & & (0.039) \\
\addlinespace
Constant & 6.860^{***} & 7.530^{***} & 7.133^{***} & 7.034^{***} & 6.273^{***} & 6.324^{***} & 6.266^{***} & 6.171^{***} \\
& (0.015) & (0.089) & (0.082) & (0.078) & (0.082) & (0.083) & (0.166) & (0.170) \\
\midrule
Observations & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}226} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} \\
$R^{2}$ & 0.056 & 0.081 & 0.270 & 0.358 & 0.455 & 0.457 & 0.457 & 0.476 \\
Adjusted $R^{2}$ & 0.056 & 0.080 & 0.269 & 0.356 & 0.453 & 0.455 & 0.455 & 0.469 \\
Resid.\ Std.\ Error & 0.406 & 0.400 & 0.357 & 0.335 & 0.309 & 0.309 & 0.309 & 0.305 \\
\qquad df & \mc{2227} & \mc{2226} & \mc{2224} & \mc{2218} & \mc{2164} & \mc{2163} & \mc{2162} & \mc{2143} \\
$F$-Statistic
& \mc{133.081} & \mc{97.706} & \mc{206.134} & \mc{176.461} & \mc{225.471 } & \mc{202.428} & \mc{182.131} & \mc{67.151} \\
\qquad df & \mc{1;2227} & \mc{2;2226} & \mc{4;2224} & \mc{7;2218} & \mc{8;2164} & \mc{9;2163} & \mc{10;2162} & \mc{29;2143} \\
\bottomrule
\addlinespace
\multicolumn{9}{@{}l}{\textit{Note}: $^{*}\ p<0.1$; $^{**}\ p<0.05$; $^{***}\ p<0.01$} \\
\end{longtable}
\endgroup
\end{document}
```
But in my opinion, this is too less margin:
So you should at least change the `longtable` declaration to:
```
\begin{longtable}{@{\hspace{.25em}\extracolsep{\fill}} l *{7}{d{2.5}} d{2.6} @{\hspace{.25em}}}
```
(I'll show the result in the next example.)
Alternatively, if you whole document should not have left and right margins, you can set `left` and `right` to 0in with `geometry`:
```
\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[margin=1in,left=0pt,right=0pt]{geometry} % set page parameters appropriately
\usepackage{longtable}
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage{dcolumn} % align numbers in columns on decimal markers
\newcolumntype{d}[1]{D..{#1}}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\begingroup % localize scope of next four instructions
\small % 10% linear reduction in font size
\setlength\tabcolsep{0pt} % let LaTeX figure out inter-column space
\setlength\LTleft{0pt}% see p. 7 of package's user guide
\setlength\LTright{0pt}%
\begin{longtable}{@{\hspace{.25em}\extracolsep{\fill}} l *{7}{d{2.5}} d{2.6} @{\hspace{.25em}}}
%% headers and footers
\caption{X} \label{tab:x} \\
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endfirsthead
\multicolumn{9}{@{}l}{Table \thetable, continued}\\
\addlinespace
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endhead
\midrule
\multicolumn{9}{r@{}}{\footnotesize (continued on next page)}\\
\endfoot
% empty final footer
\endlastfoot
%% body of table
sex & 0.226^{***} & 0.219^{***} & 0.239^{***} & 0.244^{***} & 0.131^{***} & 0.132^{***} & 0.132^{***} & 0.142^{***} \\
& (0.020) & (0.019) & (0.017) & (0.017) & (0.016) & (0.016) & (0.016) & (0.016) \\
\addlinespace
eta & & -0.009^{***} & -0.005^{***} & -0.004^{***} & -0.002^{**} & -0.002^{**} & -0.002^{**} & -0.002^{*} \\
& & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
studio\_lev2 & & & 0.330^{***} & 0.163^{***} & 0.129^{***} & 0.127^{***} & 0.127^{***} & 0.129^{***} \\
& & & (0.021) & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
studio\_lev3 & & & 0.717^{***} & 0.459^{***} & 0.420^{***} & 0.417^{***} & 0.417^{***} & 0.431^{***} \\
& & & (0.035) & (0.038) & (0.036) & (0.036) & (0.036) & (0.036) \\
\addlinespace
type\_job\_Middle-class\_worker & & & & 0.219^{***} & 0.189^{***} & 0.187^{***} & 0.187^{***} & 0.191^{***} \\
& & & & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
type\_job\_Manager & & & & 0.465^{***} & 0.418^{***} & 0.414^{***} & 0.414^{***} & 0.410^{***} \\
& & & & (0.039) & (0.037) & (0.037) & (0.037) & (0.036) \\
\addlinespace
type\_job\_Self-Employed & & & & -0.142^{***} & -0.189^{***} & -0.190^{***} & -0.189^{***} & -0.173^{***} \\
& & & & (0.022) & (0.020) & (0.020) & (0.020) & (0.020) \\
\addlinespace
acontrib & & & & & 0.020^{***} & 0.020^{***} & 0.020^{***} & 0.019^{***} \\
& & & & & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
dislav & & & & & & -0.085^{***} & -0.085^{***} & -0.050^{*} \\
& & & & & & (0.027) & (0.027) & (0.027) \\
\addlinespace
occnow & & & & & & & 0.029 & 0.075 \\
& & & & & & & (0.072) & (0.073) \\
\addlinespace
ireg2 & & & & & & & & 0.147^{*} \\
& & & & & & & & (0.080) \\
\addlinespace
ireg3 & & & & & & & & -0.005 \\
& & & & & & & & (0.032) \\
\addlinespace
ireg4 & & & & & & & & -0.054 \\
& & & & & & & & (0.039) \\
\addlinespace
ireg5 & & & & & & & & -0.012 \\
& & & & & & & & (0.034) \\
\addlinespace
ireg6 & & & & & & & & 0.067 \\
& & & & & & & & (0.050) \\
\addlinespace
ireg7 & & & & & & & & -0.080^{*} \\
& & & & & & & & (0.043) \\
\addlinespace
ireg8 & & & & & & & & 0.076^{**} \\
& & & & & & & & (0.036) \\
\addlinespace
ireg9 & & & & & & & & -0.018 \\
& & & & & & & & (0.033) \\
\addlinespace
ireg10 & & & & & & & & -0.071 \\
& & & & & & & & (0.045) \\
\addlinespace
ireg11 & & & & & & & & 0.050 \\
& & & & & & & & (0.041) \\
\addlinespace
ireg12 & & & & & & & & 0.012 \\
& & & & & & & & (0.038) \\
\addlinespace
ireg13 & & & & & & & & -0.099^{*} \\
& & & & & & & & (0.060) \\
\addlinespace
ireg14 & & & & & & & & -0.217^{***} \\
& & & & & & & & (0.056) \\
\addlinespace
ireg15 & & & & & & & & -0.091^{**} \\
& & & & & & & & (0.039) \\
\addlinespace
ireg16 & & & & & & & & -0.120^{***} \\
& & & & & & & & (0.040) \\
\addlinespace
ireg17 & & & & & & & & -0.176^{***} \\
& & & & & & & & (0.054) \\
\addlinespace
ireg18 & & & & & & & & -0.019 \\
& & & & & & & & (0.046) \\
\addlinespace
ireg19 & & & & & & & & -0.126^{***} \\
& & & & & & & & (0.044) \\
\addlinespace
ireg20 & & & & & & & & -0.021 \\
& & & & & & & & (0.039) \\
\addlinespace
Constant & 6.860^{***} & 7.530^{***} & 7.133^{***} & 7.034^{***} & 6.273^{***} & 6.324^{***} & 6.266^{***} & 6.171^{***} \\
& (0.015) & (0.089) & (0.082) & (0.078) & (0.082) & (0.083) & (0.166) & (0.170) \\
\midrule
Observations & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}226} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} \\
$R^{2}$ & 0.056 & 0.081 & 0.270 & 0.358 & 0.455 & 0.457 & 0.457 & 0.476 \\
Adjusted $R^{2}$ & 0.056 & 0.080 & 0.269 & 0.356 & 0.453 & 0.455 & 0.455 & 0.469 \\
Resid.\ Std.\ Error & 0.406 & 0.400 & 0.357 & 0.335 & 0.309 & 0.309 & 0.309 & 0.305 \\
\qquad df & \mc{2227} & \mc{2226} & \mc{2224} & \mc{2218} & \mc{2164} & \mc{2163} & \mc{2162} & \mc{2143} \\
$F$-Statistic
& \mc{133.081} & \mc{97.706} & \mc{206.134} & \mc{176.461} & \mc{225.471 } & \mc{202.428} & \mc{182.131} & \mc{67.151} \\
\qquad df & \mc{1;2227} & \mc{2;2226} & \mc{4;2224} & \mc{7;2218} & \mc{8;2164} & \mc{9;2163} & \mc{10;2162} & \mc{29;2143} \\
\bottomrule
\addlinespace
\multicolumn{9}{@{}l}{\textit{Note}: $^{*}\ p<0.1$; $^{**}\ p<0.05$; $^{***}\ p<0.01$} \\
\end{longtable}
\endgroup
\end{document}
```
You can also remove the top and the bottom margin. Please the the `geometry` manual for more information.
Just my opinion: I always find it difficult to read tables where the columns have been artificially widened. This lacks more orientation in the row and also the cohesion of the values. Because of this, I generally cannot recommend to this.
BTW: Setting `\tabcolsep` to 0pt is usually not the best idea. It can lead to the columns butting up against each other without any spacing.
| 1 | https://tex.stackexchange.com/users/277964 | 684642 | 317,620 |
https://tex.stackexchange.com/questions/684644 | 4 | What are the differences between `\visible<>{}`, `\uncover<>{}` and `\only<>{}` in beamer/tikz?
At the moment I am using them interchangeably and could not understand their particular use cases.
I think one of them already assigns the space required for the object to be revealed and one of them reveals the object and required space gradually.
Can anyone once for ever clear this up?
| https://tex.stackexchange.com/users/82925 | Difference between \uncover vs \visible vs \only? | true | Here a simple example where you can see the difference between the macros. `\visible` will reserve the space, depending on your settings `\uncover` can be dimmed on pervious overlays and `\only` is only present on the specified overlays:
```
\documentclass{beamer}
\setbeamercovered{dynamic}
\begin{document}
\begin{frame}
text \visible<2>{text} text
text \uncover<2>{text} text
text \only<2>{text} text
\end{frame}
\end{document}
```
For a more detailed explanation, see section `9.3 Commands with Overlay Specifications` of the beamer user guide <https://texdoc.org/serve/beamer/0>
| 5 | https://tex.stackexchange.com/users/36296 | 684646 | 317,622 |
https://tex.stackexchange.com/questions/684622 | 2 |
```
\documentclass[12pt, a4paper]{article}
%\pagestyle{plain}
%\usepackage[top=0.7 in,bottom=0.5 in,left=0.6 in,right=0.6 in]{geometry}
%\usepackage[parfill]{parskip}
%\setlength\parindent{0pt} % Removes all indentation from paragraphs
%\renewcommand{\baselinestretch}{1.10} %line spacing
\usepackage{enumitem}
%\usepackage{parskip}
\begin{document}
%\setlist[enumerate]{label={\arabic*.}}
\begin{enumerate}[label={\arabic*.}]
\item blah 1 222dfhkvnuittvriebvnytbyrteoy marcus polo texas polo fg polo polo marco bolo marco bolo marco bolo marco bolo
\item blah 2
\end{enumerate}
\end{document}
```
This gives
1. blah 1 222dfhkvnuittvriebvnytbyrteoy marcus polo texas polo fg polo polo marco bolo marco bolo marco bolo marco bolo.
2. blah 2
However intend to start the second line of each item from below the item number. Secondly how to adjust space between item number and start of the item
| https://tex.stackexchange.com/users/296233 | customising second line indent | false |
```
\documentclass[12pt,a4paper]{article}
%\pagestyle{plain}
%\usepackage[top=0.7 in,bottom=0.5 in,left=0.6 in,right=0.6 in]{geometry}
%\usepackage[parfill]{parskip}
%\renewcommand{\baselinestretch}{1.10} %line spacing
\usepackage{enumitem,kantlipsum}
%\usepackage{indentfirst}
%\usepackage[parfill]{parskip}
%\setlength\parindent{2pt} % Removes all indentation from paragraphs
%\raggedleft
\begin{document}
%\setlist[enumerate]{label={\arabic*.}}
\begin{enumerate}[wide, labelwidth=20pt, labelindent=0pt]
\item \kant[1]
\item test
\begin{enumerate}[wide, leftmargin=20pt, labelwidth=20pt, labelindent=23pt]
%\item \kant[3]
\item so far so good
\begin{enumerate}[wide, leftmargin=29pt, labelwidth=20pt, labelindent=28pt, label={(\roman*)}]
%\itemindent=0em
\item \kant[5]
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}
```
This solved the situation
| 1 | https://tex.stackexchange.com/users/296233 | 684648 | 317,623 |
https://tex.stackexchange.com/questions/684645 | 0 | I have the following code:
```
\begin{tikzpicture}[scale=0.6]
\draw[thick,<->] (0,14) node[above]--(0,0)--(14,0) node[right];
\draw[thick,-] (0,-1) node[above]--(0,0)--(-1,0) node[right];
\draw[very thick, green, domain=0:14] plot (\x,7);
\draw (2.3,-0.5) node[label=below: x] {};
\draw (7,-0.5) node[label=below: y] {};
\draw (11.7,-0.5) node[label=below: u] {};
\draw[color=green] (7,8.5) node[label=below: Constant] {};
\draw (3,-2.7) node[label=below: Low] {};
\draw (10,-2.7) node[label=below: High] {};
\end{tikzpicture}
```
and two questions:
1. I want to add rotated text to the y-axis. I've tried `\draw[rotate=90]…` But it doesn't work.
2. How can I duplicate the plot, so to speak, and display both plots side by side?
| https://tex.stackexchange.com/users/270806 | Help arranging text with tikz | true | Like this:
Code:
```
\documentclass[a4paper]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}[scale=.7]
% grid and axis
\draw[gray!15] (-6,-6) grid (6,6);
\draw[line width=.5pt,-latex] (-6,0)--(6,0) node[right] () {\small $x$};
\draw[line width=.5pt,-latex] (0,-6)--(0,6) node[above] () {\small $y$};
\foreach \i in {-6,-5,...,-1,1,2,...,5}{
\draw[thick] (\i,0)--(\i,-.05) node[below] () {\footnotesize \bfseries \i} ;
\draw[thick] (0,\i)--(-.05,\i) node[left] () {\footnotesize \bfseries \i} ;
\node[below left] at (0,0) {\footnotesize \bfseries 0};
}
\draw[cyan] (0,3) node[rotate=90,fill=white] () {\bfseries Text on y axis};
\draw(3,4) node[fill=red,draw=blue] () {\bfseries Text on the plane};
\draw[blue,line width=2pt] plot[domain=-5:5,smooth] (\x,{2*sin(\x r)});
\end{tikzpicture}
\begin{tikzpicture}[xshift=8,scale=.7]
% grid and axis
\draw[gray!15] (-6,-6) grid (6,6);
\draw[line width=.5pt,-latex] (-6,0)--(6,0) node[right] () {\small $x$};
\draw[line width=.5pt,-latex] (0,-6)--(0,6) node[above] () {\small $y$};
\foreach \i in {-6,-5,...,-1,1,2,...,5}{
\draw[thick] (\i,0)--(\i,-.05) node[below] () {\footnotesize \bfseries \i} ;
\draw[thick] (0,\i)--(-.05,\i) node[left] () {\footnotesize \bfseries \i} ;
\node[below left] at (0,0) {\footnotesize \bfseries 0};
}
\draw[cyan] (0,3) node[rotate=90,fill=white] () {\bfseries Text on y axis};
\draw(3,4) node[fill=red,draw=blue] () {\bfseries Text on the plane};
\draw[green,line width=2pt] plot[domain=-5:5,smooth] (\x,{2*cos(\x r)});
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/24644 | 684650 | 317,624 |
https://tex.stackexchange.com/questions/684577 | 0 | I want to show that having computed some values, my sequences appear to be eventually periodic. Both sequences are periodic after the first 34 and 48 values respectively and have period 34 and 48.
I was trying to do this by displaying a table for each with, say 4 rows and 34/48 columns, where all but the first row are identical. I thought it would also be nice to have the numbers which have changed from the first row to the second row in bold.
Obviously 34/48 columns is really large so I'm not sure how to fit it in within the line width where it is still readable and looks nice. Does anyone have any suggestions for how to implement this or a better suggestion for a nice way to display the periodic sequence?
| https://tex.stackexchange.com/users/289361 | How best to display an eventually periodic sequence in LaTeX | true | If you steal a bit of space around commas it fits in a default `article` text width. Use `b` not `bx` bold font, so the alignment is preserved.
```
\documentclass{article}
\def\,{\kern-.1pt,\kern-.4pt}
\def\!#1{{\fontseries{b}\selectfont#1}}
\begin{document}
\noindent X\dotfill X
\begin{flushleft}
\!0\,1\,1\,0\,2\,1\,3\,0\,1\,1\,3\,2\,2\,3\,4\,\!1\,5\,\!3\,2\,2\,3\,1\,1\,0\,3\,1\,2\,0\,1\,1\,4\,4\,\!2\,\\
4\,1\,1\,0\,2\,1\,3\,0\,1\,1\,3\,2\,2\,3\,4\,4\,5\,7\,2\,2\,3\,1\,1\,0\,3\,1\,2\,0\,1\,1\,4\,4\,3\,\\
4\,1\,1\,0\,2\,1\,3\,0\,1\,1\,3\,2\,2\,3\,4\,4\,5\,7\,2\,2\,3\,1\,1\,0\,3\,1\,2\,0\,1\,1\,4\,4\,3
\end{flushleft}
\noindent X\dotfill X
\begin{flushleft}
0\,1\,\!1\,1\,0\,2\,\!2\,\!1\,3\,4\,0\,1\,\!1\,1\,3\,2\,\!2\,2\,3\,4\,0\,1\,\!5\,4\,3\,2\,\!2\,2\,3\,1\,0\,1\,0\,4\,3\,\!2\,2\,2\,0\,1\,0\,1\,0\,4\,3\,2\,\!5\,\\
0\,1\,0\,1\,0\,2\,3\,2\,3\,4\,0\,1\,0\,1\,3\,2\,3\,2\,3\,4\,0\,1\,0\,4\,3\,2\,3\,2\,3\,1\,0\,1\,0\,4\,3\,2\,3\,2\,0\,1\,0\,1\,0\,4\,3\,2\,3\,\\
0\,1\,0\,1\,0\,2\,3\,2\,3\,4\,0\,1\,0\,1\,3\,2\,3\,2\,3\,4\,0\,1\,0\,4\,3\,2\,3\,2\,3\,1\,0\,1\,0\,4\,3\,2\,3\,2\,0\,1\,0\,1\,0\,4\,3\,2\,3
\end{flushleft}
\noindent X\dotfill X
\end{document}
```
| 1 | https://tex.stackexchange.com/users/1090 | 684656 | 317,627 |
https://tex.stackexchange.com/questions/684654 | 0 | I'm currently working on a book and I need to add Arabic words in the document within an English sentence. Example: "The word (arabic word) is the definition of....". I tried using `LR{}` and `{\afont "arabicword"}` but none of them work.
```
\documentclass[12pt]{book}
\usepackage[arabic,main=english]{babel}
\usepackage[sc,compact,explicit]{titlesec} % Titlesec for configuring the header
\usepackage{auto-pst-pdf} % Vectorian Ornaments XeTeX auxiliary (from:
https://tex.stackexchange.com/questions/253477/how-to-use-psvectorian-with-pdflatex)
\usepackage{psvectorian} % Vectorian Ornaments
\let\clipbox\relax % PSTricks (used by PSVectorian) already defines a \clipbox, so
we need this workaround
\usepackage{adjustbox} % Adjustbox to rescale the ornaments (scalebox breaks
titlesec for some reason...)
\newcommand{\otherfancydraw}{% Defining a command to shorten things
\begin{adjustbox}{max height=0.5\baselineskip}% Rescaling to have height of
0.5\baselineskip
\raisebox{-0.25\baselineskip}{
\rotatebox[origin=c]{45}{% And rotating 90 degrees
\psvectorian{7}% Ornament n° 26
(http://melusine.eu.org/syracuse/pstricks/vectorian/psvectorian.pdf)
}}%
\end{adjustbox}%
}
% A command to create a rule centered vertically on the text (from:
https://tex.stackexchange.com/questions/15119/draw-horizontal-line-left-and-right-of-
some-text-a-single-line/15122#15122)
\newcommand*\ruleline[1]{\par\noindent\raisebox{.8ex}{\makebox[\linewidth].
{\hrulefill\hspace{1ex}\raisebox{-.8ex}{#1}\hspace{1ex}\hrulefill}}}
\usepackage{fontspec}
\titleformat% Formatting the header
{\chapter} % command
[block] % shape - Only managed to get it working with block
{\normalfont\bfseries\sc\huge} % format - Change here as needed
{\centering Chapter \thechapter\\} % The Chapter N° label
{0pt} % sep
{\centering \ruleline{\otherfancydraw}\\ % The horizontal rule
\centering #1} % And the actual title
\usepackage{lmodern} % monospace font
\usepackage[T1]{fontenc}
\renewcommand{\ttdefault}{lmtt} % MONO Latin Modern Font % T1 encoding of cmtt font
s\renewcommand{\rmdefault}{lmr} % SERIF Latin Modern Font % T1 encoding of cmr font
st\renewcommand{\sfdefault}{lmss} % SANS Latin Modern F
\newcommand{\q}[1]{>>\textit{#1}<<}
\newcommand{\prefacename}{Preface}
\newenvironment{preface}{
\vspace*{\stretch{2}}
{\noindent \bfseries \Huge \prefacename}
\begin{center}
% \phantomsection \addcontentsline{toc}{chapter}{\prefacename} % enable this if
you want to put the preface in the table of contents
\thispagestyle{plain}
\end{center}%
}
{\vspace*{\stretch{5}}}
\usepackage{arabxetex}
\begin{document}
Test \LR{arabic word here} test test
\end{document}
```
However, this doesn't seem to work, the English word is loaded when I compile but the Arabic word is not there.
| https://tex.stackexchange.com/users/202573 | How to add Arabic in-line with English sentence in XeLaTeX? | false | For short Arabic texts, all you need is:
```
\documentclass[12pt]{book}
\usepackage[bidi=default, english]{babel}
\babelfont[arabic]{rm}{FreeSerif}
\begin{document}
One two \foreignlanguage{arabic}{لاثة أربعة} five six.
\end{document}
```
Also:
• Don’t load `fontenc`, which is for `pdflatex`, not `xelatex`.
• `arabxetex` is not necessary.
| 2 | https://tex.stackexchange.com/users/5735 | 684663 | 317,628 |
https://tex.stackexchange.com/questions/7447 | 11 | How should I change font size for the entire document? I want to design a presentation and fonts should be larger, all of them.
| https://tex.stackexchange.com/users/1449 | How to change font size in the entire document? | false |
```
\documentclass{article}
\usepackage{mathptmx}
\usepackage{anyfontsize}
\begin{document}
{\fontsize{40pt}{48pt}\selectfont 40pt,}
{\Huge It's Huge,}
{\fontsize{20pt}{24pt}\selectfont 30pt,}
{\tiny It's tiny,}
{\fontsize{3.5pt}{4.2pt}\selectfont 3.5pt,}
\end{document}
```
[source](https://latexhelp.com/latex-font-size-change/)
| 0 | https://tex.stackexchange.com/users/274274 | 684674 | 317,634 |
https://tex.stackexchange.com/questions/684677 | 3 | This question "has been answered before", but not directly to the question. My question pertains only to `LuaLaTeX`, only to OpenType fonts using UTF-8 encoding, only to text mode (not math), only to the regular main font (which has already been selected). Also, no shell escape.
I seek a true/false test, regarding whether the current font (main font) has the glyph for a specific Unicode character. It it does, I use it. If not, there is another character that certainly exists in the font, so I will use that character instead.
The specific situation: U+2015 HORIZONTAL BAR is often used to indicate the beginning of quote or dialog in some languages. Not all fonts have this character. If not, then I can substitute U+2014 EM DASH from the same font. Pseudo-code example:
```
\documentclass{article}
\usepackage{fontspec} % Compile only with lualatex
\setmainfont{EB Garamond} % Or any OpenType font.
% begin pseudo-code:
\IfFontHasCharTF{\mainfont}{"2015}{\def\myowndash{"2015}}{\def\myowndash{"2014}}
% end pseudo-code
\begin{document}
They were speaking:\par
\myowndash Hello, Harry.\par
\myowndash Hello, Sue.\par
It was a brief conversation.\par
\end{document}
```
Yes, I did look at the `fontspec` documentation. Near the end, it looks like there is some sort of Lua `aux` macro that may address this, but I do not know how to use it.
Searched before asking, but the results either used a different compiler, or not UTF-8, or involved substituting the font (rather than different character from same font).
EDIT: My above example is linguistically incorrect. An English-language resource said that the French use U+2015 where possible. But several French-language resources (I can read French) said that U+2014 (EM DASH) is used, not U+2015.
EDIT2 (Actually 3, thanks to Ingmar): The local university library had a copy of *Les Travailleurs de la Mer* by Victor Hugo, reprinted in Paris, 1980 (thus, not confused by Internet). I can see that the quotation dashes (les tirets) are longer than I would expect an em dash to be. They are indented as with any paragraph, and separated from the text by a full space. So, despite what I wrote in the first edit, it seems that U+2015 would be correct for printed works; U+2014 is used on the Internet. Actually, once it is printed to paper, it is the appearance that matters, not the character code.
| https://tex.stackexchange.com/users/287367 | Test for font character, LuaLaTeX | true | you can use `\iffontchar` as in other engines
```
% !tex lualatex
\documentclass{article}
\begin{document}
\iffontchar\font "2015 yes \else no \fi [^^^^2015]
\iffontchar\font "2212 yes \else no \fi [^^^^2212]
\end{document}
```
| 7 | https://tex.stackexchange.com/users/1090 | 684678 | 317,636 |
https://tex.stackexchange.com/questions/684679 | 1 | I'm preparing my first manuscript for journal submission with the `iopart` document class. Since it's for a publication, there are typesetting constraints imposed on me (that I'm not always aware of). I'd like to include a table in the paper, but it's too wide for the manuscript for the time being. I include the table like
```
\begin{table}
\caption{\label{tab:table} Caption.}
\begin{indented}
\footnotesize
\item[]\begin{tabular}{@{}lllllll}
\br
Heading 1 & Heading 2 & Heading 3 & Heading 4 & Heading 5 & Heading 6 & Heading 7 \\
\mr
1.1 & 1.2 & 1.3 & 1.4 & 1.5 & 1.6 & 1.7 \\
2.1 & 2.2 & 2.3 & 2.4 & 2.5 & 2.6 & 2.7 \\
\br
\end{tabular}
\end{indented}
\end{table}
```
One way to slightly narrow the table that I've seen people do is to split longer headings over two lines. How do I do that? Has anyone else written an article for an IOP journal with a wide table and can share what other tricks they used to fit it to the page within the journals's guidelines?
| https://tex.stackexchange.com/users/211197 | Table too wide in iopart class | true | Point (ii) on page 20 of the user guide of the iopart document class says the following about tables and the `indented` environment:
>
> The normal style is for tables to be indented. This is accomplished by using `\begin{indented} . . . \end{indented}` and putting `\item[]` before the start of the tabular environment. *Omit these commands* for any tables which will not fit on the page when indented. [emphasis added]
>
>
>
Since the `indented` wrapper is preventing the tabular material from fitting inside the text block, you actually have official permission to get rid of the `indented` wrapper.
```
\documentclass[12pt]{iopart}
\usepackage{showframe} % <-- draw framelines around text block
% (omit from real document)
\begin{document}
\begin{table}
\caption{Caption.}\label{tab:table}
\footnotesize
\centering % <-- new
\begin{tabular}{@{} lllllll @{}}
\br
Heading 1 & Heading 2 & Heading 3 & Heading 4 &
Heading 5 & Heading 6 & Heading 7 \\
\mr
1.1 & 1.2 & 1.3 & 1.4 & 1.5 & 1.6 & 1.7 \\
2.1 & 2.2 & 2.3 & 2.4 & 2.5 & 2.6 & 2.7 \\
\br
\end{tabular}
\end{table}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5001 | 684681 | 317,638 |
https://tex.stackexchange.com/questions/684583 | 1 | **Background:** Hello there. I read this [Q&A](https://tex.stackexchange.com/questions/639405/how-to-set-toc-title-above-its-content-when-that-is-in-two-columns), which I thought would answer my question, but I am still confused (surely due to my newness to LaTeX). I have a two-column table of contents that uses multicols and tocloft. The second/right column of toc entries starts on the same line (aka, in the same vertical orientation on the page) as the left-aligned title of the toc, which starts the left column.
**Difficulty:** I would like the title of the toc to appear above all the entries.
**Original code:**
```
\documentclass[english]{article}
\usepackage{babel}
\usepackage{multicol}
\usepackage{tocloft}
\usepackage{hyperref}
\title{This is my report}
\author{H.S.}
\date{May, 2023}
\begin{document}
\hypersetup{linktoc=all,
colorlinks=true,
linkcolor=blue}
\renewcommand{\contentsname}{Contents}
\renewcommand{\cftaftertoctitle}{\thispagestyle{empty}}
\renewcommand{\cftsecfont}{\LARGE\aftergroup \LARGE} % credit to @user691586
\setlength{\cftsecnumwidth}{0pt} %control left margin of entry lines 2+
\renewcommand\numberline[1]{} %new % Eliminate tocloft's auto section numbers
\makeatletter
\renewcommand{\@tocrmarg}{2.55em plus 1fil} %set right margin for toc
\makeatother
\renewcommand{\cfttoctitlefont}{
\fontsize{35pt}{35pt}\selectfont
\bfseries}
\begin{hyphenrules}{nohyphenation}
\setlength{\columnsep}{50pt}
\begin{multicols}{2}
\tableofcontents
\end{multicols}
\end{hyphenrules}
\clearpage
\section{Section One Title}
\clearpage
\section{Section Two Title, Long Enough for Multiple Lines}
\clearpage
\section{Section Three Title}
\clearpage
\section{Section Four Title}
\clearpage
\section{Section Five Title}
\clearpage
\section{Section Six Title}
\clearpage
\section{Section Seven Title}
\clearpage
\section{Section Eight Title}
\clearpage
\section{Section Nine Title}
\clearpage
\section{Section Ten Title}
\clearpage
\section{Section Eleven Title}
\clearpage
\section{Section Twelve Title}
\clearpage
\section{Section Thirteen Title, surely enough to hit two columns}
\end{document}
```
**First attempt at a fix:** I tried to incorporate the solution @Simon Dispa suggested [here](https://tex.stackexchange.com/questions/639405/how-to-set-toc-title-above-its-content-when-that-is-in-two-columns), but I clearly misunderstood how to include that solution because the toc page ended up being missing altogether:
```
\documentclass[english]{article}
\usepackage{babel}
\usepackage{multicol}
\usepackage{tocloft}
\usepackage{hyperref}
\title{This is my report}
\author{H.S.}
\date{May, 2023}
\begin{document}
\hypersetup{linktoc=all,
colorlinks=true,
linkcolor=blue}
\renewcommand{\contentsname}{Contents}
\renewcommand{\cftaftertoctitle}{\thispagestyle{empty}}
\makeatletter
\newcommand{\twocolumntoc}{
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\begin{multicols}{2}
\@starttoc{toc}%
\end{multicols}
\onecolumn
}
\makeatother
\clearpage
\section{Section One Title}
\clearpage
\section{Section Two Title, Long Enough for Multiple Lines}
\clearpage
\section{Section Three Title}
\clearpage
\section{Section Four Title}
\clearpage
\section{Section Five Title}
\clearpage
\section{Section Six Title}
\clearpage
\section{Section Seven Title}
\clearpage
\section{Section Eight Title}
\clearpage
\section{Section Nine Title}
\clearpage
\section{Section Ten Title}
\clearpage
\section{Section Eleven Title}
\clearpage
\section{Section Twelve Title}
\clearpage
\section{Section Thirteen Title, surely enough to hit two columns}
\end{document}
```
**Possible fix I hope to do better than:** I think I could just use \begingroup ... \endgroup twice to achieve: (1) a group that just contains text displaying the toc title; and then beneath that, (2) a group with the toc code, where the title gets suppressed with \renewcommand{\contentsname}{}. I'm guessing that would work, but based on the existence of @Simon Dispa's response to @Marton [here](https://tex.stackexchange.com/questions/639405/how-to-set-toc-title-above-its-content-when-that-is-in-two-columns), it feels like there ought to be a cleaner answer than that. But maybe not, and that's my best answer.
Thank you!
| https://tex.stackexchange.com/users/296104 | How to set TOC title above its content when using multicols and tocloft | true | This is on basis of OP original efforts; but inserting `\tableofcontents` inside the `multicols` is not obvious to rescue. Ideally, it would be better to simply look at LaTeX source code, not use `tocloft` at all, and code oneself the desired insertion of the multicols, and all various desired special things such as choice of font etc... one discovers the hooks added by `tocloft` are not the ideal means as one can not control if they are hardcoded to expand in a group for example. In the end rather than watching a log trace of the executed TeX expansion with `latex+ tocloft` better to use `latex` plus `article` (or whatever) class only, but I will here continue the `latex+article+tocloft+multicols+whatever new package...`.
```
\documentclass[english]{article}
\usepackage{babel}
\usepackage{multicol}
\usepackage{tocloft}
\usepackage{hyperref}
\usepackage{color}
\hypersetup{linktoc=all,
colorlinks=true,
linkcolor=blue}
\renewcommand{\contentsname}{Contents}% This is the default
% Toc configutation via tocloft interface. Which is not best of tools
% for us here.
\renewcommand{\cftaftertoctitle}{\thispagestyle{empty}}
\renewcommand{\cftsecfont}{\LARGE\aftergroup \LARGE} % credit to @user691586
% Eliminate tocloft's auto section numbers
\setlength{\cftsecnumwidth}{0pt} %control left margin of entry lines 2+
\renewcommand\numberline[1]{} %new
\renewcommand{\cfttoctitlefont}{% <- avoid extra space token
\fontsize{35pt}{35pt}\selectfont
\bfseries}
\makeatletter
\renewcommand{\@tocrmarg}{2.55em plus 1fil} %set right margin for toc
% must get rid to some extent of tocloft handling the TOC heading
% we did not correct various potential vertical space, not that importnat
\let\@cftmaketoctitle\@empty
\makeatother
\title{This is my report}
\author{H.S.}
\date{May, 2023}
\begin{document}
\begin{hyphenrules}{nohyphenation}
\setlength{\columnsep}{50pt}% configure multicols
% attenton that [{...}] would have multicols anyhow remove the braces
% so it should be [{{...}}] but anyhow we issue \normalfont to reset
% the font size and series; \noindent avoids indentation
\begin{multicols}{2}[\noindent\cfttoctitlefont\contentsname\normalfont]
\tableofcontents
\end{multicols}
\end{hyphenrules}
\clearpage
\section{Section One Title}
\clearpage
\section{Section Two Title, Long Enough for Multiple Lines}
\clearpage
\section{Section Three Title}
\clearpage
\section{Section Four Title}
\clearpage
\section{Section Five Title}
\clearpage
\section{Section Six Title}
\clearpage
\section{Section Seven Title}
\clearpage
\section{Section Eight Title}
\clearpage
\section{Section Nine Title}
\clearpage
\section{Section Ten Title}
\clearpage
\section{Section Eleven Title}
\clearpage
\section{Section Twelve Title}
\clearpage
\section{Section Thirteen Title, surely enough to hit two columns}
\end{document}
```
I am not sure why hyphenation should be suppressed but I kep this.
I would have rather used some `\RaggedRight` from `ragged2e`.
| 1 | https://tex.stackexchange.com/users/293669 | 684684 | 317,639 |
https://tex.stackexchange.com/questions/684291 | 1 | I have an enumerate of questions. Each of those questions has some opening text and then a nested enumerate. I give an example below that results in a page-break in the middle of the second question in the PDF output. I mark with `\newpage` where I would like the page-break to be (automatically) inserted. In this particular example, I want the first question to be on page 1, and the second and third to be on page 2 (just because they both happen to fit).
I also put my attempt commented out in below. I try to start a "samepage" environment right at the beginning of an `\item` and I try to end it at the end of the (nested) enumerate environment. The code seems to work on a simpler example, but in the current example it fails with the error `! LaTeX Error: \begin{samepage} on input line 56 ended by \end{center}.` In any case, my approach seemed fragile anyway so I'm hoping there's a better solution.
I think the reason I find this hard is because of the way `\item` works. If it were `\item{contents}` then I think it would be easier to patch. That's why I tried to hack together an approach that hooks into the beginning of `\item` and end of `\enumerate`.
I'm looking for a solution that can patch `\item` and base `enumerate` (rather than using `\newitem` or enumitem). i.e., I'm hoping that I can just drop some preamble code in.
There are related questions. For example, [Page breaks within enumerated list](https://tex.stackexchange.com/questions/76483/page-breaks-within-enumerated-list) is related but is not about nested enumerates and also the solution seems to use enumitem.
```
\documentclass{article}
\makeatletter
%% my attempt:
%\let\OldItem\item
%\renewcommand{\item}{\OldItem \ifnum \@listdepth=1 \begin{samepage}\fi}
%\AfterEndEnvironment{enumerate}{\ifnum \@listdepth=1 \end{samepage}\fi}
\makeatother
\begin{document}
\begin{enumerate}
\item 2 + 2 = ? \\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
\begin{enumerate}
\item 1
\item 2
\item 3
\item 4
\end{enumerate}
% I do not want to put this page break in manually:
% \newpage
\item Consider the joint probability distribution below:
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
\begin{center}
\begin{tabular}{|ccc|}
\hline
&
$X_{2}=0$ &
$X_{2}=1$\tabularnewline
\hline
$X_{1}=0$ &
$\frac{1}{10}$ &
$\frac{3}{10}$\tabularnewline
\hline
$X_{1}=1$ &
$\frac{2}{10}$ &
$\frac{4}{10}$\tabularnewline
\hline
\end{tabular}
\par\end{center}
What is $P(X_{1}=1)$?
\begin{enumerate}
\item I do not know.
\item 4
\item 17
\item 88
\end{enumerate}
\item 2 - 2 + 5 =
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
\begin{enumerate}
\item 1
\item 2
\item 3
\item 4
\end{enumerate}
\end{enumerate}
\end{document}
```
| https://tex.stackexchange.com/users/12212 | Prevent page break within \item of an enumerate | false | Perhaps try this. Hardly tested but appears to do what one hopes.
```
\documentclass[a4paper]{article}
% \usepackage{geometry}
\AddToHook{env/enumerate/begin}{\AddToHook{env/enumerate/begin}{\samepage}}%
\begin{document}
\begin{enumerate}
\item 2 + 2 = ? \\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
\begin{enumerate}
\item 1
\item 2
\item 3
\item 4
\end{enumerate}
% I do not want to put this page break in manually:
% \newpage
\item Consider the joint probability distribution below:
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
\begin{center}
\begin{tabular}{|ccc|}
\hline
&
$X_{2}=0$ &
$X_{2}=1$\tabularnewline
\hline
$X_{1}=0$ &
$\frac{1}{10}$ &
$\frac{3}{10}$\tabularnewline
\hline
$X_{1}=1$ &
$\frac{2}{10}$ &
$\frac{4}{10}$\tabularnewline
\hline
\end{tabular}
\par\end{center}
What is $P(X_{1}=1)$?
\begin{enumerate}
\item I do not know.
\item 4
\item 17
\item 88
\end{enumerate}
\item 2 - 2 + 5 =
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
filler\\
\begin{enumerate}
\item 1
\item 2
\item 3
\item 4
\end{enumerate}
\end{enumerate}
\end{document}
```
This will create pagebreak moving all text starting with `What is $P(X_1=1)$?` on next page. Without the hack the pagebreak occurs between `(b) 4` and `(c) 17`.
| 1 | https://tex.stackexchange.com/users/293669 | 684686 | 317,640 |
https://tex.stackexchange.com/questions/684685 | 1 | I’m fighting with babel that keeps spawning `Package tikz Error: + or - expected.` when I use the calc library. In particular, some codes only work when `\usetikzlibrary{babel}` is on, while some other codes only work when `\usetikzlibrary{babel}` is off… My sanity is seriously endangered ^^’
Right now, my only hack to make this work is to disable `\shorthandoff{!}` before the `\scalebox{}`… but I find this very inelegant as it kind of defeats the purpose of babel, in particular when nodes contain `!`. Also, as I’m writting a library, it is hard to predict in advance the list of shorthands to disable automatically…
**MWE that needs \usetikzlibrary{babel} to compile**
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[french]{babel}
\usepackage{tikz}
\usetikzlibrary{calc}
%\usetikzlibrary{babel} % If you enable this, it compiles this example, but not the other one
\NewDocumentCommand{\myAnimatedNode}{}{%
\node(afirsthidden){};%
\node(asecondhidden){};%
% Last node to be drawn
\path node[at={($(afirsthidden.center)!.5!(asecondhidden.center)$)}]{A};%
}
\begin{document}
\begin{tikzpicture}
\myAnimatedNode
\end{tikzpicture}
\end{document}
```
**MWE that fail with \usetikzlibrary{babel}**
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[french]{babel} % Use \begin{frame}[fragile] everywhere or you will get weird stuff with tikz
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{babel} % If you disable this, then it compiles this example, but not the other one
\begin{document}
\scalebox{.5}{
\begin{tikzpicture}
\node(a){};
\node(b){};
\node[] at ($(a.north)!.5!(b.north)$){};
\end{tikzpicture}
}
%\end{frame}
\end{document}
```
**Combinaison of the two that will never compile**
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[french]{babel}
\usepackage{tikz}
\usetikzlibrary{calc}
% This document will never compile
\usetikzlibrary{babel}
\NewDocumentCommand{\myAnimatedNode}{}{%
\node(afirsthidden){};%
\node(asecondhidden){};%
% Last node to be drawn
\path node[at={($(afirsthidden.center)!.5!(asecondhidden.center)$)}]{A};%
}
\begin{document}
\begin{tikzpicture}
\myAnimatedNode
\end{tikzpicture}
\scalebox{.5}{
\begin{tikzpicture}
\node(a){};
\node(b){};
\node[] at ($(a.north)!.5!(b.north)$){};
\end{tikzpicture}
}
\end{document}
```
| https://tex.stackexchange.com/users/116348 | Babel drives me crazy with Package tikz Error: + or - expected | false | There are many ways of making `!` safe, for example
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[french]{babel}
\usepackage{tikz}
\usetikzlibrary{calc}
% This document will never compile
\usetikzlibrary{babel}
\NewDocumentCommand{\myAnimatedNode}{}{%
\node(afirsthidden){};%
\node(asecondhidden){};%
% Last node to be drawn
\path node[at={($(afirsthidden.center)!.5!(asecondhidden.center)$)}]{A};%
}
\begin{document}
\begin{tikzpicture}
\myAnimatedNode
\end{tikzpicture}
\scalebox{.5}{%
\begin{tikzpicture}
\node(a){};
\node(b){};
\node[] at \expanded{($(a.north)\string!.5\string!(b.north)$){}};
\end{tikzpicture}%
}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/1090 | 684692 | 317,642 |
https://tex.stackexchange.com/questions/684694 | 1 | I’m trying to get biblatex (which I use with biber) to produce citations like follows when citing conference proceedings
```
Authors (CONF name abbreviation - date)
```
For example, [this paper](https://proceedings.mlr.press/v37/sohl-dickstein15.html) shourd get cited as (in text)
```
Sohl-Dickstein et al. (ICML 2015)
```
Is there a standard way to do that? I suppose I could take advantage of the `eventtitle` bibtex field, is that what it is meant for?
---
Stripped down example of my use-case:
```
\documentclass[ignorenonframetext,]{beamer}
\usepackage[backend=biber,bibstyle=authoryear,sorting=ynt]{biblatex}
\addbibresource{./resources/bibliography.bib}
\title{Title}
\begin{document}
\begin{frame}{\textcite{sohl-dicksteinDeepUnsupervisedLearning2015}}
Some explanations on that paper
\end{frame}
\end{document}
```
Current bibtex file:
```
@inproceedings{sohl-dicksteinDeepUnsupervisedLearning2015,
title = {Deep {{Unsupervised Learning}} Using {{Nonequilibrium Thermodynamics}}},
booktitle = {Proceedings of the 32nd {{International Conference}} on {{Machine Learning}}},
author = {{Sohl-Dickstein}, Jascha and Weiss, Eric and Maheswaranathan, Niru and Ganguli, Surya},
year = {2015},
month = jun,
pages = {2256--2265},
publisher = {{PMLR}},
issn = {1938-7228},
urldate = {2023-01-07},
langid = {english},
}
```
Expected output:
* one frame whose title is "Sohl-Dickstein et al. (ICML 2015)
" (ICML stands for International Conference on Machine Learning)
| https://tex.stackexchange.com/users/249195 | BibLaTeX – Cite as "Author et al. (Conference abbrev - year)" | true | You can create your own cite command (`\citeconf` in my example), adding `shorttitle={ICML}` in your bibitem:
```
\begin{filecontents*}[overwrite]{bibliography.bib}
@inproceedings{sohl-dicksteinDeepUnsupervisedLearning2015,
title = {Deep {{Unsupervised Learning}} Using {{Nonequilibrium Thermodynamics}}},
booktitle = {Proceedings of the 32nd {{International Conference}} on {{Machine Learning}}},
shorttitle={ICML},
author = {{Sohl-Dickstein}, Jascha and Weiss, Eric and Maheswaranathan, Niru and Ganguli, Surya},
year = {2015},
month = jun,
pages = {2256--2265},
publisher = {{PMLR}},
issn = {1938-7228},
urldate = {2023-01-07},
langid = {english},
}
\end{filecontents*}
\documentclass[ignorenonframetext,]{beamer}
\usepackage[bibstyle=authoryear,sorting=ynt]{biblatex}
\addbibresource{bibliography.bib}
\DeclareCiteCommand{\citeconf}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}}
{\printnames{labelname}
\mkbibparens{%
\printfield{shorttitle}%
\addspace%
\printfield{year}%
}%
}
{\multicitedelim}
{}
\title{Title}
\begin{document}
\begin{frame}{\citeconf{sohl-dicksteinDeepUnsupervisedLearning2015}}
Some explanations on that paper
\end{frame}
\begin{frame}{Bibliography}
\printbibliography
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/101651 | 684695 | 317,643 |
https://tex.stackexchange.com/questions/684688 | 3 | To this snippet
```
\def\arg#1#2{\#1 = #1 and \#2 = #2\par}
\arg A B C
\end
```
I supposed the output like this one
>
> #1 = A and #2 =
>
> B C
>
>
>
But I get (using PDFTeX)
>
> #1 = A and #2 = B
>
> C
> .
>
>
>
Why such behavior? I know that space is ignored in some situation (e. g., after a macro) but not, accordingly to my understanding, in this case. What did Mr. Knuth have in mind that none have tell me yet?
| https://tex.stackexchange.com/users/202757 | Parameter text getter | true | On page 201 of the TeXbook you find
>
> you are allowed to put spaces
> between the arguments (e.g., ‘`\row x n`’), because TeX doesn't
> use single spaces as undelimited arguments.
>
>
>
There’s also another point worthy of attention on page 204
>
> Argument `#1` will be the token `Look`, since `#1` is an undelimited
> parameter (it is followed immediately by `#2` in the definition);
> in this case TeX ignores the blank space after `B`, and strips the
> braces off of `{\Look}`.
>
>
>
The gist of this is that spaces are effectively ignored if they precede an undelimited argument. You *cannot* have a space as an undelimited argument unless you brace it (and the braces will be stripped off).
```
\def\arg#1#2{\#1 = $\langle$#1$\rangle$ and \#2 = $\langle$#2$\rangle$\par}
\arg A{ }B C
\arg A { } B C
\end
```
| 4 | https://tex.stackexchange.com/users/4427 | 684703 | 317,648 |
https://tex.stackexchange.com/questions/657248 | 0 | Starting from the answer to this question [YAML Syntax Highlighting](https://tex.stackexchange.com/questions/145504/yaml-syntax-highlighting/657205#657205).
If I wanted to have "- name:" colored blue and not black, and "test" colored in blue, how is this possible?
```
spec:
containers:
- name: test
```
| https://tex.stackexchange.com/users/280046 | LATEX - How to write \lstdefinestyle for the YAML language | false | I needed to achieve a similar result, for a docker-compose YAML, and it was not immediate to find an answer. Anyway, this is a method that could allow you to achieve a result similar to the desired one:
* Define a custom language similar to the following
```
\usepackage{listingsutf8}
\usepackage[usenames]{color}
\usepackage{xcolor}
\lstdefinelanguage{my-yaml}{
keywords={spec, containers, name}, % ,... all the keyword you want
keywordstyle=\color{blue}\bfseries,
moredelim=[is][commentstyle]{||}{££}, % invisible custom delimiters
identifierstyle=\color{black},
sensitive=false,
comment=[l]{\#},
commentstyle=\color{olive}\ttfamily,
stringstyle=\color{orange}\ttfamily,
morestring=[b]',
morestring=[b]"
}
```
* use it as follows
```
\begin{lstlisting}[language=my-yaml,caption={Docker Compose YAML composing the various containers of the setup together.},numbers=left]
spec:
containers:
- name: ||test££
\end{lstlisting}
```
This is the end result:
| 4 | https://tex.stackexchange.com/users/283601 | 684705 | 317,650 |
https://tex.stackexchange.com/questions/684577 | 0 | I want to show that having computed some values, my sequences appear to be eventually periodic. Both sequences are periodic after the first 34 and 48 values respectively and have period 34 and 48.
I was trying to do this by displaying a table for each with, say 4 rows and 34/48 columns, where all but the first row are identical. I thought it would also be nice to have the numbers which have changed from the first row to the second row in bold.
Obviously 34/48 columns is really large so I'm not sure how to fit it in within the line width where it is still readable and looks nice. Does anyone have any suggestions for how to implement this or a better suggestion for a nice way to display the periodic sequence?
| https://tex.stackexchange.com/users/289361 | How best to display an eventually periodic sequence in LaTeX | false | Here's a visual way to do it.
Main steps:
* `\A` and `\B` provide the data
* package `datatool (\DTL...)` gives access to the individual data
* the `\renewcommand`s define, how the data are printed
* a simple `\rule{}{}` creates a barchart-like diagram
* change width and height there
* introduce textcolor for the rules, if you like
```
\documentclass[10pt]{article}
\usepackage{calc}% to calculate rule-heights
\usepackage{datatool}
% ~~~ data ~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand\A[0]{%
0,1,1,0,2,1,3,0,1,1,3,2,2,3,4,1,5,3,2,2,3,1,1,0,3,1,2,0,1,1,4,4,2, 4,1,1,0,2,1,3,0,1,1,3,2,2,3,4,4,5,7,2,2,3,1,1,0,3,1,2,0,1,1,4,4,3, 4,1,1,0,2,1,3,0,1,1,3,2,2,3,4,4,5,7,2,2,3,1,1,0,3,1,2,0,1,1,4,4,3}
\newcommand\B[0]{%
0,1,1,1,0,2,2,1,3,4,0,1,1,1,3,2,2,2,3,4,0,1,5,4,3,2,2,2,3,1,0,1,0,4,3,2,2,2,0,1,0,1,0,4,3,2,5, 0,1,0,1,0,2,3,2,3,4,0,1,0,1,3,2,3,2,3,4,0,1,0,4,3,2,3,2,3,1,0,1,0,4,3,2,3,2,0,1,0,1,0,4,3,2,3, 0,1,0,1,0,2,3,2,3,4,0,1,0,1,3,2,3,2,3,4,0,1,0,4,3,2,3,2,3,1,0,1,0,4,3,2,3,2,0,1,0,1,0,4,3,2,3}
% ~~~ what the datatool (DTL) shall print ~~~~~~~~~~~~~~
\renewcommand{\DTLlistformatsep}{}% no commas printed
\renewcommand{\DTLlistformatlastsep}{}% no spacing between last two items
\renewcommand{\DTLandname}{}% no "and", "&" etc. between last two items
\renewcommand{\DTLlistformatitem}[1]{\rule{2.2pt}{1cm*#1}}% bars=rule
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
Sequence A, with \DTLnumitemsinlist{\A}{\listnum}\listnum \ data:
\fbox{\DTLformatlist{\A}}
\bigskip
Sequence B, with \DTLnumitemsinlist{\B}{\listnum}\listnum \ data:
\fbox{\DTLformatlist{\B}}
\bigskip
Both sequences are periodic after about $30$ \% of data, measured from the start.
\end{document}
```
| 1 | https://tex.stackexchange.com/users/245790 | 684717 | 317,656 |
https://tex.stackexchange.com/questions/684577 | 0 | I want to show that having computed some values, my sequences appear to be eventually periodic. Both sequences are periodic after the first 34 and 48 values respectively and have period 34 and 48.
I was trying to do this by displaying a table for each with, say 4 rows and 34/48 columns, where all but the first row are identical. I thought it would also be nice to have the numbers which have changed from the first row to the second row in bold.
Obviously 34/48 columns is really large so I'm not sure how to fit it in within the line width where it is still readable and looks nice. Does anyone have any suggestions for how to implement this or a better suggestion for a nice way to display the periodic sequence?
| https://tex.stackexchange.com/users/289361 | How best to display an eventually periodic sequence in LaTeX | false | Here's a way combining the `\rules` approach with `tikz`. This may be helpful when indicating periodic effects, like so:
New:
* `textcolor` for `\rule`
* embedding the barchart-text in a `tikz-node`
* adding same lines and text to the `tikzpicture` via `\draw`
Uncomment the `help lines` for adjusting the lines drawn.
```
\documentclass[10pt]{article}
\usepackage{calc}% to calculate rule-heights
\usepackage{datatool}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usepackage{color}
% ~~~ data ~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand\A[0]{%
0,1,1,0,2,1,3,0,1,1,3,2,2,3,4,1,5,3,2,2,3,1,1,0,3,1,2,0,1,1,4,4,2, 4,1,1,0,2,1,3,0,1,1,3,2,2,3,4,4,5,7,2,2,3,1,1,0,3,1,2,0,1,1,4,4,3, 4,1,1,0,2,1,3,0,1,1,3,2,2,3,4,4,5,7,2,2,3,1,1,0,3,1,2,0,1,1,4,4,3}
\newcommand\B[0]{%
0,1,1,1,0,2,2,1,3,4,0,1,1,1,3,2,2,2,3,4,0,1,5,4,3,2,2,2,3,1,0,1,0,4,3,2,2,2,0,1,0,1,0,4,3,2,5, 0,1,0,1,0,2,3,2,3,4,0,1,0,1,3,2,3,2,3,4,0,1,0,4,3,2,3,2,3,1,0,1,0,4,3,2,3,2,0,1,0,1,0,4,3,2,3, 0,1,0,1,0,2,3,2,3,4,0,1,0,1,3,2,3,2,3,4,0,1,0,4,3,2,3,2,3,1,0,1,0,4,3,2,3,2,0,1,0,1,0,4,3,2,3}
% ~~~ what the datatool (DTL) shall print ~~~~~~~~~~~~~~
\renewcommand{\DTLlistformatsep}{}% no commas printed
\renewcommand{\DTLlistformatlastsep}{}% no spacing between last two items
\renewcommand{\DTLandname}{}% no "and", "&" etc. between last two items
\renewcommand{\DTLlistformatitem}[1]{\textcolor{blue}{\rule{2.2pt}{1cm*#1}}}% bars=rule
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
\begin{tikzpicture}
% \draw [help lines] (-3,-3) grid (3,3);
\node {\DTLformatlist{\A}};
\draw [dashed,red] (-1,-3) -- (-1,4);% indicator
\end{tikzpicture}
\bigskip
\begin{tikzpicture}
% \draw [help lines] (-3,-3) grid (3,3);
\node {\DTLformatlist{\B}};
\draw [dashed,red] (-1.8 ,-3) -- (-1.8 ,3);% indicator
\draw [dashed,red] ( 1.85,-3) -- ( 1.85,3);% indicator
\draw [{Stealth}-{Stealth},red!70] (-1.8,2.6) -- node [yshift=1em] {periodic} ( 1.85,2.6);
\end{tikzpicture}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/245790 | 684718 | 317,657 |
https://tex.stackexchange.com/questions/297737 | 3 | I have two different dates in my LaTeX document which are not current dates (dates which come in my LaTeX template from the web form).
They look like this: `2016-03-31`, but I want these dates be in the format `dd/mm/yyyy`.
What I'm doing right now is using the package `\usepackage[ddmmyyyy]{date time}`
and put inside the `\date{}` in my dates, but it doesn't change the format of the dates. How do I change the format of the dates correctly?
| https://tex.stackexchange.com/users/96760 | Date formatting: Changing from web format to another format | false |
```
\documentclass{article}
\usepackage[en,useregional]{datetime2}
\DTMnewdatestyle{mydateformat}{
\renewcommand{\DTMdisplaydate}[4]{
\DTMtwodigits{##3}~\DTMenglishmonthname{##2}~\number##1
}
\renewcommand{\DTMDisplaydate}[4]{%
\DTMdisplaydate{##3}{##2}{##1}{##4}%
}%
}
\DTMsetdatestyle{mydateformat}
\begin{document}
\DTMdate{2022-3-2} % (02 March 2022)When you input date as YYYY-MM-DD format
\\
\DTMDate{3-6-2023} % (03 June 2023)When you input date as DD-MM-YYYY fomat
\end{document}
```
Here it will show the date like 04 May 2023 format
To show dd-mm-yyyy or yyyy-mm-dd format to DD MMMM YYYY format like to show 2-9-2022 to 02 September 2022
| 1 | https://tex.stackexchange.com/users/296308 | 684723 | 317,659 |
https://tex.stackexchange.com/questions/681711 | 2 | I have a research article which is accepted (and has title, journal and doi, but no date or issue yet). A preprint is available. I'd like to have an item in my biblatex-bibliography that reflects this. I'm using standard numeric style at the moment. I'd think of something like
```
Bubaya. “Some smart paper.” To appear in: Exclusive journal. DOI: ... Preprint: arXiv:...,
```
but I am flexible. I think you got the idea. What I don't like so far is messing with related articles, but maybe I just didn't do it right.
How do I achieve something like this?
A similar question was asked already ([biblatex & references: unpublished style with eprint](https://tex.stackexchange.com/questions/8288/biblatex-references-unpublished-style-with-eprint?rq=1)), but gave no satisfactory answer.
Edit: Would the downvoter mind explaining what disturbs them, such that I can change my question? Arguably, the following looks really bad:
```
\documentclass{article}
\usepackage{biblatex,hyperref}
\begin{filecontents}[overwrite]{bib.bib}
@article{entry,
author = "W. Crawley-Boevey",
title = "Decomposition of pointwise finite-dimensional persistence modules",
journal = "Journal of Algebra and Its Applications",
volumne = "14",
number = "5",
year = "2015",
pubstate = "forthcoming",
doi = "10.1142/S0219498815500668",
eprint = "1210.0819",
eprinttype = "arxiv",
}
\end{filecontents}
\addbibresource{bib.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
```
| https://tex.stackexchange.com/users/27717 | Add eprint to unpublished bibliography items | true | You can modify the macros that print the involved fields as follow, testing the `pubstate`:
```
\documentclass{article}
\usepackage{biblatex,hyperref}
\begin{filecontents}[overwrite]{bib.bib}
@article{entry,
author = "W. Crawley-Boevey",
title = "Decomposition of pointwise finite-dimensional persistence modules",
journal = "Journal of Algebra and Its Applications",
volume = "14",
number = "5",
year = "2015",
pubstate = "forthcoming",
doi = "10.1142/S0219498815500668",
eprint = "1210.0819",
eprinttype = "arxiv",
}
@article{arta,
author = "A. Author",
title = "An ordinary article",
journal = "An ordinary journal",
volume = "15",
number = "1",
year = "2016",
pubstate = "published",
doi = "10.1234/S0219498815501234",
eprint = "1234.1234",
eprinttype = "arxiv",
}
@article{artb,
author = "B. Buthor",
title = "A second article",
journal = "A second journal",
volume = "16",
number = "3",
year = "2020",
doi = "10.7777/S0219498815501234",
eprint = "1234.7777",
eprinttype = "arxiv",
}
@article{artc,
author = "C. Cuthor",
title = "A submitted article",
journal = "A third journal",
year = "2023",
pubstate = "submittedto",
doi = "10.7777/S0219498815501234",
eprint = "1234.7777",
eprinttype = "arxiv",
}
\end{filecontents}
\addbibresource{bib.bib}
% from https://tex.stackexchange.com/a/408041/101651
\NewBibliographyString{toappearin}
\NewBibliographyString{submittedto}
\NewBibliographyString{preprint}
\DefineBibliographyStrings{english}{%
toappearin = {to appear in},
submittedto = {submitted to},
preprint = {preprint},
}
\renewbibmacro*{in:}{%
\ifboolexpr{not test {\iffieldundef{pubstate}}
and (test {\iffieldequalstr{pubstate}{toappearin}}
or test{\iffieldequalstr{pubstate}{submittedto}}
or test{\iffieldequalstr{pubstate}{forthcoming}}
)}
{\printtext{\bibstring{toappearin}\intitlepunct}}%
{\printtext{\bibstring{in}\intitlepunct}}%
}
% from https://tex.stackexchange.com/q/295080/101651
\makeatletter
\DeclareFieldFormat*{eprint:arxiv}{{% Note the extra brace
\ifboolexpr{not test {\iffieldundef{pubstate}}
and (test {\iffieldequalstr{pubstate}{toappearin}}
or test{\iffieldequalstr{pubstate}{submittedto}}
or test{\iffieldequalstr{pubstate}{forthcoming}}
)}
{\printtext{\bibstring{preprint}\addcolon\addspace arXiv}}%
{arXiv}%ù
\addcolon\space
\ifhyperref
{\href{http://arxiv.org/\abx@arxivpath/#1}{%
\nolinkurl{#1}%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
{\nolinkurl{#1}
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}}
\makeatother
\renewbibmacro*{addendum+pubstate}{%
\printfield{addendum}}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
```
| 1 | https://tex.stackexchange.com/users/101651 | 684730 | 317,664 |
https://tex.stackexchange.com/questions/684577 | 0 | I want to show that having computed some values, my sequences appear to be eventually periodic. Both sequences are periodic after the first 34 and 48 values respectively and have period 34 and 48.
I was trying to do this by displaying a table for each with, say 4 rows and 34/48 columns, where all but the first row are identical. I thought it would also be nice to have the numbers which have changed from the first row to the second row in bold.
Obviously 34/48 columns is really large so I'm not sure how to fit it in within the line width where it is still readable and looks nice. Does anyone have any suggestions for how to implement this or a better suggestion for a nice way to display the periodic sequence?
| https://tex.stackexchange.com/users/289361 | How best to display an eventually periodic sequence in LaTeX | false | You can just input the first two rows and have automatically the changed items emphasized.
```
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
% eventually periodic
\NewDocumentCommand{\ep}{O{}mm}
{% #1 = font size, #2 = first row, #3 = further rows
\mbox { #1 \max_ep:nn { #2 } { #3 } }
}
\seq_new:N \l__max_ep_first_in_seq
\seq_new:N \l__max_ep_first_out_seq
\seq_new:N \l__max_ep_second_seq
\cs_new_protected:Nn \max_ep:nn
{
\seq_set_from_clist:Nn \l__max_ep_first_in_seq { #1 }
\seq_set_from_clist:Nn \l__max_ep_second_seq { #2 }
\seq_clear:N \l__max_ep_first_out_seq
\seq_mapthread_function:NNN \l__max_ep_first_in_seq \l__max_ep_second_seq \__max_ep_diff:nn
\begin{tabular}{@{}l@{}}
\seq_use:Nn \l__max_ep_first_out_seq { , } , \\
\seq_use:Nn \l__max_ep_second_seq { , } , \\
\seq_use:Nn \l__max_ep_second_seq { , } , \\
\dots
\end{tabular}
}
\cs_new_protected:Nn \__max_ep_diff:nn
{
\str_if_eq:nnTF { #1 } { #2 }
{% items are equal
\seq_put_right:Nn \l__max_ep_first_out_seq { #1 }
}
{% items differ
\seq_put_right:Nn \l__max_ep_first_out_seq
{ \makebox[\fontcharwd\font`0]{\fontseries{b}\selectfont #1} }
}
}
\ExplSyntaxOff
\begin{document}
\noindent X\dotfill X
\begin{flushleft}
\ep{
0,1,1,0,2,1,3,0,1,1,3,2,2,3,4,1,5,3,2,2,3,1,1,0,3,1,2,0,1,1,4,4,2
}{
4,1,1,0,2,1,3,0,1,1,3,2,2,3,4,4,5,7,2,2,3,1,1,0,3,1,2,0,1,1,4,4,3
}
\end{flushleft}
\noindent X\dotfill X
\begin{flushleft}
\ep[\small]{
0,1,1,1,0,2,2,1,3,4,0,1,1,1,3,2,2,2,3,4,0,1,5,4,3,2,2,2,3,1,0,1,0,4,3,2,2,2,0,1,0,1,0,4,3,2,5
}{
0,1,0,1,0,2,3,2,3,4,0,1,0,1,3,2,3,2,3,4,0,1,0,4,3,2,3,2,3,1,0,1,0,4,3,2,3,2,0,1,0,1,0,4,3,2,3
}
\end{flushleft}
\noindent X\dotfill X
\end{document}
```
The idea is to populate two sequences with the given arguments. The first one is compared with the second one item by item, adding the item as is if there's no change, with boldface selected otherwise.
Next a tabular is made by using the sequences, with commas reinserted.
An optional argument for a font size selection can be used if the sequence is too long.
The curious
```
\makebox[\fontcharwd\font`0]{\fontseries{b}\selectfont #1}
```
is because bold is not optically scaled in Computer Modern, so I set the different digit in a box as wide as the normal ones.
In the following version, `*` in the first argument means a blank.
```
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
% eventually periodic
\NewDocumentCommand{\ep}{O{}mm}
{% #1 = font size, #2 = first row, #3 = further rows
\mbox { #1 \max_ep:nn { #2 } { #3 } }
}
\seq_new:N \l__max_ep_first_in_seq
\seq_new:N \l__max_ep_first_out_seq
\seq_new:N \l__max_ep_second_seq
\cs_new_protected:Nn \max_ep:nn
{
\seq_set_from_clist:Nn \l__max_ep_first_in_seq { #1 }
\seq_set_from_clist:Nn \l__max_ep_second_seq { #2 }
\seq_clear:N \l__max_ep_first_out_seq
\seq_mapthread_function:NNN \l__max_ep_first_in_seq \l__max_ep_second_seq \__max_ep_diff:nn
\begin{tabular}{@{}l@{}}
\seq_use:Nn \l__max_ep_first_out_seq { } \\
\seq_use:Nn \l__max_ep_second_seq { , } , \\
\seq_use:Nn \l__max_ep_second_seq { , } , \\
\dots
\end{tabular}
}
\cs_new_protected:Nn \__max_ep_diff:nn
{
\str_if_eq:nnTF { #1 } { * }
{% blank
\seq_put_right:Nn \l__max_ep_first_out_seq { \mbox{\phantom{0,}} }
}
{% non blank
\str_if_eq:nnTF { #1 } { #2 }
{% items are equal
\seq_put_right:Nn \l__max_ep_first_out_seq { #1, }
}
{% items differ
\seq_put_right:Nn \l__max_ep_first_out_seq
{ \makebox[\fontcharwd\font`0]{\fontseries{b}\selectfont #1}, }
}
}
}
\ExplSyntaxOff
\begin{document}
\noindent X\dotfill X
\begin{flushleft}
\ep{
0,1,1,0,2,1,3,0,1,1,3,2,2,3,4,1,5,3,2,2,3,1,1,0,3,1,2,0,1,1,4,4,2
}{
4,1,1,0,2,1,3,0,1,1,3,2,2,3,4,4,5,7,2,2,3,1,1,0,3,1,2,0,1,1,4,4,3
}
\end{flushleft}
\noindent X\dotfill X
\begin{flushleft}
\ep[\small]{
0,1,1,1,0,2,2,1,3,4,0,1,1,1,3,2,2,2,3,4,0,1,5,4,3,2,2,2,3,1,0,1,0,4,3,2,2,2,0,1,0,1,0,4,3,2,5
}{
0,1,0,1,0,2,3,2,3,4,0,1,0,1,3,2,3,2,3,4,0,1,0,4,3,2,3,2,3,1,0,1,0,4,3,2,3,2,0,1,0,1,0,4,3,2,3
}
\end{flushleft}
\noindent X\dotfill X
\begin{flushleft}
\ep{
*,1,2,3,4,5,6
}{
0,0,2,3,4,5,6
}
\end{flushleft}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/4427 | 684734 | 317,666 |
https://tex.stackexchange.com/questions/109309 | 4 | I was wondering if there was any way to flip a transistor or similar node component around in the [`circuitikz`](http://www.ctan.org/pkg/circuitikz) package? For the bipoles it's fairly simple as you just reverse the start and end, but for more advanced circuits I'm having trouble (things such as current mirrors or what have you). I've seen various solutions on scaling up and down, but none on flipping.
| https://tex.stackexchange.com/users/29221 | Flipping Transistors with Circuiktikz | false | use `invert` or `mirror`, this is the most easy way to flip a component.
| 1 | https://tex.stackexchange.com/users/295524 | 684736 | 317,667 |
https://tex.stackexchange.com/questions/683700 | 1 | I have using `TeXLive 2023` Windows and when running `make4ht -ux -m draft -a debug filename.tex` make4ht is not working and system is hanging. My MWE is:
```
\documentclass[utf8]{FrontiersinHarvard}
\usepackage{url,hyperref,lineno,microtype,subcaption,algorithmic,algorithm}
\usepackage[onehalfspacing]{setspace}
\DeclareMathOperator*{\argmax}{argmax}
\DeclareMathOperator*{\argmin}{argmin}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\renewcommand{\algorithmiccomment}[1]{\bgroup\hfill~#1\egroup}
\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}
\def\keyFont{\fontsize{9}{11}\helveticabold }
\def\firstAuthorLast{} %use et al only if is more than 1 author
\def\Authors{Yu Zhu\,$^{*}$ and Santiago Segarra}
\def\Address{Department of Electrical and Computer Engineering, Rice University, Houston, TX, United States}
\def\corrAuthor{Yu Zhu}
\def\corrEmail{yz126@rice.edu}
\begin{document}
\onecolumn
\firstpage{1}
\title[Hypergraphs with Vertex Weights]{Hypergraphs with Vertex Weights: $p$-Laplacians Clustering}
\author[\firstAuthorLast ]{\Authors} %This field will be automatically populated
\address{} %This field will be automatically populated
\correspondance{} %This field will be automatically populated
\extraAuth{}
\maketitle
\begin{abstract}
We study world data demonstrate the effectiveness of combining spectral clustering based on the $1$-Laplacian and EDVW.
\keyFont{ \textbf{Keywords:} hypergraphs, $p$-Laplacian, clustering, edge-dependent weights}
\end{abstract}
\section{Introduction}\label{s1:intro}
Spectral clustering makes use of eigenvalues and eigenvectors of graph Laplacians to group vertices in a graph.
\end{document}
```
LaTeX Template is available <https://www.frontiersin.org/design/zip/Frontiers_LaTeX_Templates.zip>
| https://tex.stackexchange.com/users/49758 | Section Tag not working Make4ht | false | The problem here is with the custom class, which doesn't load any standard class, but defines sections, titles, and all other elements manually. Custom classes usually load Article or Book internally, and redefine only elements related to the document design. In this way, TeX4ht can still insert basic HTML tags even if it doesn't support the custom class itself.
Fortunately, I've found that you can still load TeX4ht definitions for Article to get the basic tags. You only need to redefine some commands that cause problems. Here is the `FrontiersinHarvard.4ht` file:
```
\ifdefined\listoffigures\else\def\listoffigures{\relax}\fi
\ifdefined\listoftables\else\def\listoftables{\relax}\fi
\def\section{%
\@startsection{section}{1}{\z@}
{-10\p@ plus -3\p@}{3\p@}
{\reset@font\raggedright\helveticabold\fontsize{13}{13}\color{black}\selectfont}}
\renewenvironment{subfigure}{\ifsub@@figure\global\sub@@figurefalse\stepcounter{figure}\fi%
\@float{subfigure}}{\end@float}
\renewenvironment{subfigure*}{\ifsub@@figure\global\sub@@figurefalse\stepcounter{figure}\fi%
\@float{subfigure}}{\end@float}
\input article.4ht
```
I had to fix several problems: `\listoftables` and `\listoffigures` are not defined by `FrontiersinHarvard.cls` but redefined in `article.4ht`, so we need to declare a dummy version of this command to prevent runtime error. I also had to fix the `\section` command because the version from the class caused an infinite loop. I also had to add the `subfigure` and `subfigure*` environments; these caused errors too.
With this file, you can compile your file:
| 1 | https://tex.stackexchange.com/users/2891 | 684741 | 317,671 |
https://tex.stackexchange.com/questions/629153 | 1 | In Overleaf after importing package `hyperref` like this:
```
\usepackage[colorlinks=true, linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}
```
I am using the `figure` environment adding a label after the caption like this:
```
\begin{figure}
\centering
\includegraphics[width=10cm]{Screenshot 2022-01-04 121837.jpg}
\caption{A schematic of a simple conventional solar cell. Creation of electron–hole pairs, e− and h+, respectively, is depicted.Reprinted from \emph{Handbook of Photovoltaic Science and Engineering} (Chapter 3 Physics of Solar cells, JL Gray, p.83), by A.Luque and S. Hegedus 2003, Wiley, Copyright © 2003 John Wiley \& Sons, Ltd}
\label{fig:my_label9}
\end{figure}
```
and then using `\autoref{fig:my_label9}` to hyperlink it.
All works normally except the fact that on clicking the link I am led to the caption and one has to scroll up to look at the figure. It would be nice if we could show the entire figure with the caption on clicking.
On request in a comment, I am attaching a minimalistic code to explain the problem which you could copy and run in Overleaf
```
\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage[colorlinks=true, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
\begin{document}
\section{Introduction}
The birds appears in figure number \autoref{fig:birds}
\begin{figure}[h!]
\includegraphics[scale=1.7]{universe.jpg}
\caption{The Universe}
\label{fig:universe}
\end{figure}
\newpage
\begin{figure}[h!]
\includegraphics[scale=1.7]{birds.jpg}
\caption{The birds}
\label{fig:birds}
\end{figure}
\end{document}
```
Click on the hyperlink to understand the problem.
| https://tex.stackexchange.com/users/260889 | Figure referencing using \autoref takes the cursor to the caption | false | Additional to the hyperref package, use the caption package as well.
```
\usepackage{hyperref}
\usepackage{caption}
```
This should fix the problem
| 0 | https://tex.stackexchange.com/users/296336 | 684747 | 317,674 |
https://tex.stackexchange.com/questions/684748 | 2 | I want to create a table but there are two problems. Firstly, the size of the table is so big. The second problem is a vertical line in the first cell from the left hand. How I can Make the table smaller and also in the center of the page, also how I can remove that vertical line?
```
\documentclass{article}
% Language setting
% Replace `english' with e.g. `spanish' to change the document language
\usepackage[english]{babel}
\usepackage{soul}
\usepackage{longtable}
\pagestyle{empty}
% Set page size and margins
% Replace `letterpaper' with `a4paper' for UK/EU standard size
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\begin{document}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}\hline
\multicolumn{2}{|l|}{\multirow{2}{*}{Models}} & \multicolumn{4}{|l|}{DR(eye)VE} & \multicolumn{4}{|l|}{DR(eye)VE} & \multicolumn{4}{|l|}{DR(eye)VE} & \multicolumn{4}{|l|}{DR(eye)VE} \\ \cline{3-18}
&& CC & KLD & SIM & NSS &CC & KLD & SIM & NSS &CC & KLD & SIM & NSS &CC & KLD & SIM & NSS \\ \cline{2-18}
\end{tabular}
\end{document}
```
| https://tex.stackexchange.com/users/296335 | Resizing the table | true | You can set font size as `\small` and reduce the column sep. `tabularray` is easy to use.
```
\documentclass{article}
\pagestyle{empty}
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
\usepackage{tabularray}
\begin{document}
\begin{table}
\caption{title}
\begin{tblr}
{
colspec = {*{17}{Q[co=-1,c,m]}},
hlines,
vlines,
cells = {cmd=\small},
columns = {colsep=0pt},
cell{1}{2,6,10,14} = {c=4}{},
cell{1}{1} = {r=2}{},
}
Models & DR(eye)VE & & & & DR(eye)VE & & & & DR(eye)VE & & & & DR(eye)VE & & & \\
& CC & KLD & SIM & NSS & CC & KLD & SIM & NSS & CC & KLD & SIM & NSS & CC & KLD & SIM & NSS \\
\end{tblr}
\end{table}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/238422 | 684750 | 317,675 |
https://tex.stackexchange.com/questions/684743 | 2 | I'm trying to manually process a list of authors.
The logic works in the document, but not it does not seem to work when I pass it to hypersetup.
```
\documentclass{article}
\usepackage{authblk}
\usepackage{etoolbox}
\usepackage{hyperref}
%%%%%%%%%%%%%% Logic to process author list, e.g., part of some package %%%%%%%%%%%%%
%Define lists
\newcommand{\authlist}{}
\newcounter{nMYauthors}
\newcommand\MYauthor[2][]{\author[#1]{#2}\listadd{\authlist}{#2}\stepcounter{nMYauthors}}
%Define processing of list
\newcommand{\bodyforloop}[1]{\stepcounter{iMYauthor}\ifnumequal{\value{iMYauthor}}{1}{}{\ifnumequal{\value{nMYauthors}}{\value{iMYauthor}}{, and }{, }}#1}
\newcounter{iMYauthor}
\newcommand{\displayAuthorList}{\setcounter{iMYauthor}{0}\forlistloop{\bodyforloop}{\authlist}}
%%%%%%%%%%%%%%%% Define authors in preamble %%%%%%%%%%%%%
\MYauthor[*]{Ms. F. First}
\MYauthor[*]{Mr. S. Second}
\affil[*]{\LaTeX amateurs}
%This generates errors
\hypersetup{pdfauthor = {\displayAuthorList}}
\begin{document}
The new author list works in the document: \displayAuthorList
\end{document}
```
The errors I get is: Missing endcsname when passing command to hypersetup
Anyone any ideas on how to solve this?
| https://tex.stackexchange.com/users/30958 | Missing endcsname when passing command to hypersetup | true | You need to use an expandable command.
For this application it makes sense to redefine `\author`.
I set up a (global) list management, that can be reused for other purposes. The `\delivergloballist` command takes as arguments the list name, the separator between only two elements, the separator between more than two elements and the separator for the last two elements.
```
\documentclass{article}
\usepackage{authblk}
\usepackage{hyperref}
% Manage lists
\ExplSyntaxOn
\NewDocumentCommand{\definegloballist}{m}
{
\seq_new:c { g_dikdirk_list_#1_seq }
}
\NewDocumentCommand{\addtogloballist}{mm}
{
\seq_gput_right:cn { g_dikdirk_list_#1_seq } { #2 }
}
\NewExpandableDocumentCommand{\deliverlist}{mmmm}
{
\seq_use:cnnn { g_dikdirk_list_#1_seq } { #2 } { #3 } { #4 }
}
\ExplSyntaxOff
\definegloballist{authors}
\NewCommandCopy\authblkauthor\author
\RenewDocumentCommand{\author}{om}{%
\IfNoValueTF{#1}{\authblkauthor{#2}}{\authblkauthor[#1]{#2}}%
\addtogloballist{authors}{#2}%
}
%Define processing of list
\newcommand{\displayAuthorList}{%
\deliverlist{authors}{ and }{, }{, and }%
}
%%%%%%%%%%%%%%%% Define authors in preamble %%%%%%%%%%%%%
\author[*]{Mrs. F. First}
\author[*]{Mr. S. Second}
\affil[*]{\LaTeX amateurs}
\hypersetup{pdfauthor = {\displayAuthorList}}
\begin{document}
\title{Example paper}
\maketitle
The new author list works also in the document:
\displayAuthorList
\end{document}
```
The output of `pdfinfo` is
```
Title:
Subject:
Keywords:
Author: Mrs. F. First and Mr. S. Second
Creator: LaTeX with hyperref
Producer: pdfTeX-1.40.25
CreationDate: Thu May 4 16:05:47 2023 CEST
ModDate: Thu May 4 16:05:47 2023 CEST
Custom Metadata: yes
Metadata Stream: no
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 1
Encrypted: no
Page size: 612 x 792 pts (letter)
Page rot: 0
File size: 46742 bytes
Optimized: no
PDF version: 1.5
```
| 4 | https://tex.stackexchange.com/users/4427 | 684751 | 317,676 |
https://tex.stackexchange.com/questions/149431 | 11 | I just started trying out latexdiff for editing some papers and I am having trouble with the getting the tex output from latexdiff compile when my code includes `\intertext` within a `\begin{align*}` environment. This is the error I get
```
Underfull \hbox (badness 10000) in paragraph at lines 83--86
[1{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
/Users/erikchan/Desktop/TSWLatexianTemp_000048.tex:131: Misplaced alignment tab character &.
\math@cr@@@ ->&
\omit \global \advance \row@ \@ne \ifst@rred \nonumber \fi \if@eqnsw \global \tag@true \fi \ifnum \column@ >\maxfields@ \ifcheckat@ \begingroup \measuring@false \@amsmath@err {Extra & on this line}{\the \andhelp@ }\endgroup \else \global...
l.131 }\end{align*}
?
```
The version of latexdiff I am running is
```
This is LATEXDIFF 1.0.3 (Algorithm::Diff 1.1902, Perl v5.12.4).
```
Thank you in advance.
Edit: I should add that I made several attempts to find a solution to this, but I couldn't find an existing solution online and this error completely mystifies me because I don't understand why it is complaining about my alignment tab.
Edit2: I tried to look for the error and I still cannot find it. If it is a syntax error, is it common for latexDiff to output code with syntax errors?
```
\documentclass[12pt,letterpaper]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL Lecture.tex Tue Dec 10 18:18:33 2013
%DIF ADD Lecture 2.tex Tue Dec 10 18:17:11 2013
\usepackage{anysize}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{cite}
\usepackage{graphicx}
\usepackage{mathrsfs}
\usepackage{upgreek}
\usepackage{enumerate}
\usepackage{pictexwd,dcpic}
\newcommand{\Int}{\operatorname{Int}}
\newcommand{\cl}{\operatorname{Cl}}
\newcommand{\se}{\subseteq}
\newcommand{\bs}{\\ $\left.\right.\hfill\blacksquare$}
\newcommand{\C}{\mathbb{C}}
\newcommand{\D}{\mathcal{D}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\T}{\mathcal{T}}
\newcommand{\es}{\varnothing}
\newcommand{\sm}[2]{#1\setminus#2}
\newcommand{\pf}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\pfn}[3]{\frac{\partial^{#3} #1}{\partial {#2}^{#3}}}
\newcommand{\op}[1]{\operatorname{#1}}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\newtheorem{example}{Example}[section]
% unnumbered environments:
\theoremstyle{remark}
\newtheorem*{remark}{Remark}
\newtheorem*{notation}{Notation}
\newtheorem*{note}{Note}
%DIF PREAMBLE EXTENSION ADDED BY LATEXDIFF
%DIF UNDERLINE PREAMBLE %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF
\begin{document}
\author{}
\date{}
\title{Wavelets and Signal Processing}
\maketitle
A wavelet is just a small portion of a larger signal. We wish to express the signal as the sum of waves, so given a signal \DIFdelbegin \DIFdel{$\vec f$}\DIFdelend \DIFaddbegin \DIFadd{$ f$}\DIFaddend , we wish to write it as
$$\vec f = \sum_{k=1}^{n} c_{k}\vec{w}_{k}$$
where $c_{k}$ are the coefficients and $\vec{w}_{k}$ are the wavelets. The key here is that we must find a way to compute the coefficients \DIFdelbegin \DIFdel{$c_{k}$}\DIFdelend \DIFaddbegin \DIFadd{$c_{1k}$}\DIFaddend . Given a random vectors $w_{k}$, how difficult is it to calculate the $c_{k}s$.
If we have a random vector it is $\mathcal{O}(N^{3})$. If we have orthogonal vector's $\mathcal{O}(N^{2})$, if we use the FFT, we have $\mathcal{O}(N\log(N))$, but with wavelets, it is only $\mathcal{O}(N)$.
\subsubsection*{Example of wavelets}
The Haar Wavelet. Takes discrete values of $0,1,-1$.\\
The ``Mexican Hat Wavelet'' or Ricker wavelet, which is the second derivative of a guassian $e^{-x^{2}}$. Daubechies wavelet, which is continuous and nowhere differentiable.
\subsubsection*{Gram Schmidt Process}
To implement Gram Schmidt in MATLAB, we construct a matrix $C$ where
$$C = [ \langle u_{j},u_{k}\rangle]$$
the matrix of inner products, let $L$ be the lower triangular part of the Cholesky decomposition, then the inverse transpose will give the coefficients of the basis in its columns.\\\\
Given vectors $\{u_{i}\}_{i=1}^{n}$, we find vectors $\{v_{i}\}_{i=1}^{n}$ that are orthonormal and span the same space as $\{u_{i}\}_{i=1}^{n}$. By Cholesky decomposition, define the matrix of vectors $u_{i}$ as its columns
$$U = \begin{bmatrix}
u_{1}, u_{2},\dots, u_{n}
\end{bmatrix}$$
Then $U^{*}U$ is symmetric positive definite, which implies a cholesky decomposition $LL^{*}$ exists, where $L$ is lower triangular with diagonal entries are all positive. Finally, we write
$$V = U(L^{-1})^{*} = \begin{bmatrix}
v_{1} v_{2} \dots v_{n}
\end{bmatrix}$$
then the columns of $V$ ar ethe orthonormal vectors we want. Let us prove that these columns are orthonormal
$$V^{*}V = [U(L^{-1})^{*}]^{*} U(L^{-1})^{*} = L^{-1}U^{*} U(L^{*})^{-1} = L^{-1} L L^{*}(L^{*})^{-1} = I$$
Now let us show that $v's$ span the same space as the $u$'s. Since
$$\begin{bmatrix}
v_{1}v_{2}..v_{n}
\end{bmatrix} = V = U(L^{*})^{-1} = \begin{bmatrix}
u_{1}&u_{2}&\dots &u_{n}
\end{bmatrix}
\begin{bmatrix}
\ell_{11} & \ell_{1,2} & \ell_{1,3} &\dots\\
0 & \ell_{2,2} & \dots & \dots\\
0 & 0 & \ell_{3,3} & \dots\\
\end{bmatrix}$$
\DIFaddbegin \DIFadd{So
}\begin{align*}\DIFadd{
\vec{v}_{1} }&\DIFadd{= \ell_{1,1}\vec{u}_{1}}\\
\DIFadd{\vec{v}_{2} }&\DIFadd{= \ell_{1,3} \vec{u}_{1} + \ell_{2,2} \vec{u_{2}}}\\
\DIFadd{\vec{v}_{3} }&\DIFadd{= \ell_{1,3} \vec{u}_{1} + \ell_{2,3}\vec{u_{2}} + \ell_{3,3}\vec{u}_{3}
}\end{align*}
\DIFadd{But what about functions? We instead take $u$ whose ``matrix'' columns are functions. Then calculate $U^{*}U$ as usual, and each element of the matrix becomes inner products.
}\begin{align*}\DIFadd{U }&\DIFadd{= \begin{bmatrix}
1 & x & x^{2} & x^{3}
\end{bmatrix}}\\
\DIFadd{\intertext{Then}}\\
\DIFadd{UU^{*} }&\DIFadd{= \begin{bmatrix}
\langle 1,1\rangle & \langle 1,x\rangle & \langle 1,x^{2}\rangle \\
\dots & \dots & \dots
\end{bmatrix}.
}\end{align*}
\DIFaddend\end{document}
```
| https://tex.stackexchange.com/users/42547 | Error compiling a latexdiff PDF file | false | I've found that the default options (which use underline or strikethrough) cause the most problems, as does trying to markup changes in Math mode. Changing these often gets it to work for me (though it may not be as visually pleasing), e.g., try
`latexdiff --math-markup="off" -t CFONT oldFile.tex newFile.tex > differences.tex`
| 1 | https://tex.stackexchange.com/users/4603 | 684755 | 317,677 |
https://tex.stackexchange.com/questions/684762 | 3 | Using lualatex, TeXlive 2023.
I have discovered something that works using "brute force".
Now, I would like to make it work "according to the rules".
Situation: In a word processor, two hyphens `--` are converted to emdash.
But it is three hyphens `---` in plain text, which TeX Ligatures
(feature `tlig`) converts to emdash. Having read TeX tutorials (!) the user
types `---` into a word processor, which is immediately changed to emdash
followed by a hyphen. This is hard to notice. When the text is exported to
plain text, then typeset by LuaLaTeX, the result is emdash followed
by hyphen (also hard to notice in the PDF).
Desired result:
Have LuaLaTeX convert the emdash hyphen, into only an emdash. There is no
known occasion that requires emdash followed by hyphen.
Brute Force solution (works):
In file `luaotfload-features.lua` add the following code, immediately after
the emdash `tlig` is defined:
```
[0x2014] = {0x2014, 0x002D},
```
My question: Other than hacking file `luaotfload-features.lua`, how can
that be done?
Comment: Literary authors often have to communicate with an editor, who will
only review files in MS Word format (without any TeX markup).
| https://tex.stackexchange.com/users/287367 | Luaotfload for emdash hyphen | true | First a note regarding the "Brute Force solution": While it does successfully turn `—-` into `—`, it breaks the normal `---` ligature which afterward gets turned into `–-` (an en-dash followed by a hyphen).
Generally changing the behavior of existing features is a bad idea since they no longer behave in expected ways and it's hard to find out where changes come from. Instead such changes can be done by adding a new custom feature (which then can be enabled by default in e.g. fontspec if desired). This could be done by adding in the preamble:
```
\directlua{
fonts.handlers.otf.addfeature {
name = 'rallg_hyphens',
type = 'ligature',
data = {
[0x2014] = {0x2014, 0x002D},
},
}
}
% To enable it by default in fontspec similar to tlig also add:
\defaultfontfeatures+
[\rmfamily,\sffamily]
{RawFeature=rallg_hyphens}
```
| 7 | https://tex.stackexchange.com/users/80496 | 684768 | 317,683 |
https://tex.stackexchange.com/questions/684769 | 6 |
```
\documentclass{article}
\usepackage{xstring}
\begin{document}
\StrBehind[2]{/foo/bar}{/}
\StrCount{/foo/bar}{/}
\StrBehind[\StrCount{/foo/bar}{/}]{/foo/bar}{/}
\end{document}
```
I'm trying to delete `/foo/` out of `/foo/bar` using `xstring`. The first line in the document above does produce `bar` and the second line does produce `2`, but the third line doesn't work. How do I make it work, or is there a simpler approach to do what I want?
| https://tex.stackexchange.com/users/171866 | Delete string up to last slash | false | I think a `listofitems` approach is simpler.
```
\documentclass{article}
\usepackage{listofitems}
\setsepchar[,]{/}%
\newcommand\postslash[1]{\readlist\myparse{#1}\myparse[-1]}
\begin{document}
\postslash{/foo/bar}
\postslash{bar}
\postslash{/foo/baz/bar}
\end{document}
```
| 7 | https://tex.stackexchange.com/users/25858 | 684770 | 317,684 |
https://tex.stackexchange.com/questions/684769 | 6 |
```
\documentclass{article}
\usepackage{xstring}
\begin{document}
\StrBehind[2]{/foo/bar}{/}
\StrCount{/foo/bar}{/}
\StrBehind[\StrCount{/foo/bar}{/}]{/foo/bar}{/}
\end{document}
```
I'm trying to delete `/foo/` out of `/foo/bar` using `xstring`. The first line in the document above does produce `bar` and the second line does produce `2`, but the third line doesn't work. How do I make it work, or is there a simpler approach to do what I want?
| https://tex.stackexchange.com/users/171866 | Delete string up to last slash | true | If I understand well what do you want: to expand the last segment separated by slashes from the parameter, i.e. `/foo/bar` should expand to `bar` and `/foo/bar/next` should expand to `next`. You can define following macro (using only TeX primitives):
```
\def\afterlastslash#1{\afterlsA#1/\end}
\def\afterlsA#1/#2{\ifx#2\end #1\else \expandafter\afterlsA\expandafter#2\fi}
\afterlastslash{/foo/bar} % expands to bar
\afterlastslash{/foo/bar/next} % expands to next
```
| 12 | https://tex.stackexchange.com/users/51799 | 684771 | 317,685 |
https://tex.stackexchange.com/questions/684748 | 2 | I want to create a table but there are two problems. Firstly, the size of the table is so big. The second problem is a vertical line in the first cell from the left hand. How I can Make the table smaller and also in the center of the page, also how I can remove that vertical line?
```
\documentclass{article}
% Language setting
% Replace `english' with e.g. `spanish' to change the document language
\usepackage[english]{babel}
\usepackage{soul}
\usepackage{longtable}
\pagestyle{empty}
% Set page size and margins
% Replace `letterpaper' with `a4paper' for UK/EU standard size
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\begin{document}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}\hline
\multicolumn{2}{|l|}{\multirow{2}{*}{Models}} & \multicolumn{4}{|l|}{DR(eye)VE} & \multicolumn{4}{|l|}{DR(eye)VE} & \multicolumn{4}{|l|}{DR(eye)VE} & \multicolumn{4}{|l|}{DR(eye)VE} \\ \cline{3-18}
&& CC & KLD & SIM & NSS &CC & KLD & SIM & NSS &CC & KLD & SIM & NSS &CC & KLD & SIM & NSS \\ \cline{2-18}
\end{tabular}
\end{document}
```
| https://tex.stackexchange.com/users/296335 | Resizing the table | false | For the sake of completeness, here's a `tabularx`-based solution, with a target width of `\textwidth`.
```
\documentclass{article}
\usepackage[english]{babel}
\pagestyle{empty}
\usepackage[letterpaper,vmargin=2cm,hmargin=3cm,
marginparwidth=1.75cm]{geometry}
\usepackage{multirow,tabularx,ragged2e}
\newcolumntype{C}{>{\Centering}X} % centered version of `X` col. type
\begin{document}
\begingroup % localize scope of next two instructions
\setlength\tabcolsep{1pt} % default: 6pt
\setlength\extrarowheight{2pt} % for a less-cramped "look"
\noindent
\begin{tabularx}{\textwidth}{@{} l @{\hspace{3pt}} | *{16}{C|} }
\cline{2-17}
\multirow{2}{*}{Models}
& \multicolumn{4}{c|}{DR(eye)VE} & \multicolumn{4}{c|}{DR(eye)VE}
& \multicolumn{4}{c|}{DR(eye)VE} & \multicolumn{4}{c|}{DR(eye)VE} \\
\cline{2-17}
& CC & KLD & SIM & NSS & CC & KLD & SIM & NSS
& CC & KLD & SIM & NSS & CC & KLD & SIM & NSS \\
\cline{2-17}
\end{tabularx}
\endgroup
\end{document}
```
| 3 | https://tex.stackexchange.com/users/5001 | 684776 | 317,686 |
https://tex.stackexchange.com/questions/684769 | 6 |
```
\documentclass{article}
\usepackage{xstring}
\begin{document}
\StrBehind[2]{/foo/bar}{/}
\StrCount{/foo/bar}{/}
\StrBehind[\StrCount{/foo/bar}{/}]{/foo/bar}{/}
\end{document}
```
I'm trying to delete `/foo/` out of `/foo/bar` using `xstring`. The first line in the document above does produce `bar` and the second line does produce `2`, but the third line doesn't work. How do I make it work, or is there a simpler approach to do what I want?
| https://tex.stackexchange.com/users/171866 | Delete string up to last slash | false | Here's an `expl3` implementation, named `\getbasename`. We add `/\q_nil/` at the end and test two items at a time (the first can be empty).
Similarly defined is `\getdirname` that returns the path.
```
\documentclass{article}
\ExplSyntaxOn
\NewExpandableDocumentCommand{\getbasename}{m}
{
\michel_getbasename:w #1/\q_nil/
}
\cs_new:Npn \michel_getbasename:w #1/#2/
{
\quark_if_nil:nTF { #2 }
{% reached the end, return the previous item
#1
}
{% go on: put back #2/ and test again
\michel_getbasename:w #2/
}
}
\NewExpandableDocumentCommand{\getdirname}{m}
{
\michel_getdirname:w #1/\q_nil/
}
\cs_new:Npn \michel_getdirname:w #1/#2/
{
\quark_if_nil:nF { #2 }
{% return #1/ and go on: put back #2/ and test again
#1/
\michel_getdirname:w #2/
}
}
\ExplSyntaxOff
\begin{document}
\getbasename{/foo/bar}
\getbasename{foo/bar}
\getbasename{/foo//bar}
\getbasename{/foo/bar/next}
X\getbasename{}X
X\getbasename{/}X
X\getbasename{/foo/}X
\getdirname{/foo/bar}
\getdirname{foo/bar}
\getdirname{/foo//bar}
\getdirname{/foo/bar/next}
X\getdirname{}X
\getdirname{/}
\getdirname{/foo/}
\end{document}
```
The last three examples with `\getbasename` and the first one with `\getdirname` return nothing, as witnessed by “XX”.
The function `\quark_if_nil:nTF` returns true if its (braced) argument contains only `\q_nil`, false otherwise.
| 2 | https://tex.stackexchange.com/users/4427 | 684780 | 317,688 |
https://tex.stackexchange.com/questions/684777 | 3 | I want to define a restriction operator `\restrict{f}{X}` which is capable of resizing in the style of `mathtools`'s `\DeclarePairedDelimiter` options. For example:
* `\restrict*{f}{X}` should resize automatically
* `\restrict[\Big]{f}{X}` should provide a large vertical bar regardless of what `f` is
* &c.
The MWE I currently have throws an error:
```
\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\DeclarePairedDelimiterXPP{\restrict}[2]{}{}\rvert
{\IfNoValueTF{#2}{}{_{#2}}}
{#1}
\begin{document}
\begin{equation}
\restrict{f}{X}
= \restrict*{\frac{f}{1}}{X}
\end{equation}
\end{document}
```
When running this, I get an appropriate output, but the error:
`Missing delimiter (. inserted).`
This makes sense, since the left delimiter I provided was the empty token `{}`. However, if I replace it with `{.}`, then for the *nonstarred* `\restrict`, a period is introduced in the typesetting which I do not wish for.
Is there a way to communicate to `\DeclarePairedDelimiter` that I want an empty delimiter, or must I go the route of error-surpressing?
| https://tex.stackexchange.com/users/47778 | Include empty delimiter in `\DeclarePairedDelimiter` | true | Don't use `\DeclarePairedDelimiter`.
```
\documentclass{article}
\usepackage{mathtools}
\usepackage{mleftright}
\NewDocumentCommand{\restrict}{sO{}mm}{%
\IfBooleanTF{#1}{% star
\mleft.\kern-\nulldelimiterspace
#3
\mright|%
}{% no star
#3#2|%
}%
% the subscript
_{#4}%
}
\begin{document}
\begin{equation}
\restrict{f}{X} = \restrict*{\frac{f}{1}}{X} = \restrict[\Big]{f}{X}
\end{equation}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/4427 | 684783 | 317,690 |
https://tex.stackexchange.com/questions/274362 | 2 | Assume I write something about LaTeX in email. I use UTF-8 so I can use any UNICODE character I want. Which characters should I technically use for name "LaTeX"? I believe that LaTeX originally did not mean letters L + a + T + e + X (that is, mixture of uppercase and lowercase ASCII characters). I know that usually LaTeX is written in ASCII characters only outside LaTeX source code where one just enters `\LaTeX`.
| https://tex.stackexchange.com/users/10044 | What UNICODE characters should I use to write LaTeX? | false | At least currently, there isn't a way to replicate the appearance of the LaTeX logo in normal text with Unicode. If you're using LaTeX, just use `\LaTeX` to insert the logo. If you're using some other typesetting program, you *may* be able to shift the letters around to match the logo. But otherwise, it's probably best just to stick to the standard plaintext "LaTeX". If you try hard enough you can come up with some fancier options, but none of them are particularly attractive (LᴬTᴇX? LᵃTₑX?), and definitely none of them is official.
| 3 | https://tex.stackexchange.com/users/296360 | 684786 | 317,692 |
https://tex.stackexchange.com/questions/684769 | 6 |
```
\documentclass{article}
\usepackage{xstring}
\begin{document}
\StrBehind[2]{/foo/bar}{/}
\StrCount{/foo/bar}{/}
\StrBehind[\StrCount{/foo/bar}{/}]{/foo/bar}{/}
\end{document}
```
I'm trying to delete `/foo/` out of `/foo/bar` using `xstring`. The first line in the document above does produce `bar` and the second line does produce `2`, but the third line doesn't work. How do I make it work, or is there a simpler approach to do what I want?
| https://tex.stackexchange.com/users/171866 | Delete string up to last slash | false | I tried doing the same thing with `\expandafter`s, with no sucess. Besides, that much inline code is ugly.
```
\documentclass{article}
\usepackage{xstring}
\begin{document}
\StrCount{/foo/bar}{/}[\temp]
\StrBehind[\temp]{/foo/bar}{/}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/34505 | 684795 | 317,696 |
https://tex.stackexchange.com/questions/684808 | 4 | The following code utilizes the `tcolorbox` package to create a template of a round rectangle `gamebox`. A simple `\foreach` statement prints gamebox with the strings `Lv. 0` to `Lv. 103` printed on them. I nulled `before` and overrode `after` to `\hfill` so that the boxes are well-aligned, making it easy to cut them. `\noindent` was included in the loop to prevent the first line's indentation.
```
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper,landscape,left=0.7cm,right=0.7cm,top=0.5cm,bottom=0.5cm]{geometry}
\usepackage{tcolorbox}
\tcbuselibrary{most}
\usepackage{tikz}
\title{}
\author{}
\begin{document}
\newtcbox{\gamebox} {
fontupper=\fontsize{0.7cm}{0.7cm}\selectfont\bfseries,
width=3cm,
boxrule=0.1cm,
height=1.5cm,
halign=center,
valign=center,
before=,
after=\hfill,
tcbox width=forced center
}
\foreach \i in {0,...,103} {
\noindent
\gamebox{Lv. \i}
}
\end{document}
```
However the last line(96 to 103) of the PDF output is a bit off. Regardless of how I adjust the page margins and box sizes, the last line seems to have a slightly smaller `\hfill` than the others, and the difference becomes noticeable in the latter columns. Does `LaTeX` reserve space for the end of the last line by default? If so how can I disable this function to get a perfect 8x13 placement?
| https://tex.stackexchange.com/users/296378 | tcolorbox boxes in last line are slightly misaligned | false | You have after every box an `\hfill` provided by the `tcolorbox`, a normal space (the one introduced by the end-of-line after `\gamebox{Lv. \i}`, which can shrink or stretch a little), and a final space after you close the `\foreach`, after the last `}`. Finally, there is an end-of-paragraph, which makes the normal spaces their nominal size (more or less, I think it's an `\hfil`). So the spaces in the normal lines and the last one are not exactly the same size.
You can for example remove the last (end-of-paragraph) space with an `\unskip` at the end:
```
...
\gamebox{Lv. \i}
}\unskip
...
```
Or remove every spurious space:
```
...
\foreach \i in {0,...,103} {%
\noindent
\gamebox{Lv. \i}%
}%
...
```
Anyway, to put things in a grid, I would use a tabular structure (and `tcolorbox` has a "roster" functionality) to create similar things.
| 3 | https://tex.stackexchange.com/users/38080 | 684810 | 317,702 |
https://tex.stackexchange.com/questions/684806 | 1 | I am currently writing in an IEEE Access Latex format. The work I am doing involves long arrays which I am facing difficulty facing in a single column. The arrays tend to overlap with the text in the next column.
(Array overlapping with text. (<https://i.stack.imgur.com/6yyFR.jpg>)
Here are the arrays:
```
$H_\mathbb{\mathbb{P}}
=${\scriptsize$\left\{\begin{matrix}{c}H_{\widehat{p}_1}=\{ \langle
\varrho_1,([0.3,0.5],[0.1,0.5]),(0.4,0.6)\rangle, \langle
\varrho_2,([0.3,0.4],[0.1,0.5]),(0.4,0.5)\rangle, \langle \varrho_3,([0.2,0.6],[0.1,0.4]),(0.3,0.6))\rangle \},\\
H_{\widehat{p}_2}=\{ \langle
\varrho_1,([0.1,0.4],[0.4,0.6]),(0.2,0.7)\rangle, \langle
\varrho_2,([0.2,0.4],[0.5,0.6]),(0.1,0.4)\rangle, \langle \varrho_3,([0.3,0.8],[0.1,0.2]),(0.6,0.1)\rangle \},\\
H_{\widehat{p}_3}=\{ \langle
\varrho_1,([0.2,0.6],[0.1,0.3]),(0.2,0.6)\rangle, \langle
\varrho_2,([0.2,0.4],[0.1,0.4]),(0.3,0.5)\rangle, \langle \varrho_3,([0.1,0.2],[0.3,0.8]),(0.3,0.5)\rangle\},\\
H_{\widehat{p}_4}=\{ \langle
\varrho_1,([0.1,0.4],[0.3,0.6]),(0.1,0.8)\rangle,\langle
\varrho_2,([0.1,0.5],[0.1,0.3]),(0.3,0.5)\rangle, \langle \varrho_3,([0.2,0.3],[0.2,0.7]),(0.2,0.4)\rangle \}\\
\end{matrix}
\right \}$
\begin{center}
$I_\mathbb{\mathbb{P}}
=${\scriptsize$\left\{\begin{array}{c}H_{\widehat{p}_1}=\{ \langle
\varrho_1,([0.2,0.7],[0.1,0.2]),(0.3,0.5)\rangle, \langle
\varrho_2,([0.3,0.6],[0.2,0.4]),(0.4,0.6)\rangle, \langle \varrho_3,([0.4,0.5],[0.2,0.4]),(0.6,0.3))\rangle \},\\
H_{\widehat{p}_2}=\{ \langle
\varrho_1,([0.1,0.5],[0.3,0.5]),(0.5,0.4)\rangle, \langle
\varrho_2,([0.2,0.4],[0.5,0.6]),(0.1,0.9)\rangle, \langle \varrho_3,([0.2,0.6],[0.1,0.3]),(0.5,0.4)\rangle \},\\
H_{\widehat{p}_3}=\{ \langle
\varrho_1,([0.6,0.8],[0.1,0.2]),(0.4,0.5)\rangle, \langle
\varrho_2,([0.1,0.6],[0.1,0.3]),(0.2,0.8)\rangle, \langle \varrho_3,([0.1,0.3],[0.2,0.7]),(0.2,0.4)\rangle\},\\
H_{\widehat{p}_4}=\{ \langle
\varrho_1,([0.3,0.4],[0.5,0.6]),(0.6,0.3)\rangle,\langle
\varrho_2,([0.7,0.8],[0.1,0.2]),(0.7,0.2)\rangle, \langle \varrho_3,([0.6,0.7],[0.2,0.3]),(0.1,0.5)\rangle \}\\
\end{array}
\right \}$}
\end{center}
\begin{center}
$J_\mathbb{\mathbb{P}}
=${$\left\{\begin{array}{c}H_{\widehat{p}_1}=\{ \langle
\varrho_1,([0.2,0.5],[0.1,0.4]),(0.6,0.2)\rangle, \langle
\varrho_2,([0.1,0.3],[0.2,0.7]),(0.7,0.1)\rangle, \langle \varrho_3,([0.5,0.8],[0.1,0.2]),(0.9,0.1))\rangle \},\\
H_{\widehat{p}_2}=\{ \langle
\varrho_1,([0.4,0.5],[0.1,0.3]),(0.6,0.3)\rangle, \langle
\varrho_2,([0.3,0.6],[0.2,0.4]),(0.2,0.7)\rangle, \langle \varrho_3,([0.4,0.6],[0.2,0.3]),(0.2,0.8)\rangle \},\\
H_{\widehat{p}_3}=\{ \langle
\varrho_1,([0.3,0.8],[0.1,0.2]),(0.3,0.6)\rangle, \langle
\varrho_2,([0.1,0.5],[0.3,0.5]),(0.3,0.4)\rangle, \langle \varrho_3,([0.2,0.4],[0.1,0.3]),(0.4,0.3)\rangle\},\\
H_{\widehat{p}_4}=\{ \langle
\varrho_1,([0.3,0.6],[0.1,0.3]),(0.1,0.5)\rangle,\langle
\varrho_2,([0.4,0.5],[0.2,0.4]),(0.7,0.2)\rangle, \langle \varrho_3,([0.7,0.8],[0.1,0.2]),(0.8,0.1)\rangle \}\\
\end{array}
\right \}$}
\end{center}
\noindent Now, a reference set is used for comparison of the alternatives so the closest to the ideal alternative is selected. Assume the properties of an ideal storage facility for cement are recorded in the form of an n-tuple to see the
highest level of n-tuple compliance with $H_\mathbb{\mathbb{P}}$, $I_\mathbb{\mathbb{P}}$ and $J_\mathbb{\mathbb{P}}$.
For this purpose, a list is compiled with different storage options they have currently available out of which their aim is to the select the closest to the ideal option. Most of the data for considering the similarity between the presented options is available in the form of human intuition allowing room for uncertainty which is best dealt using fuzzy structures. The list in the form of CIFHSS is shown below:
\begin{center}
$$ R_\mathbb{\mathbb{P}}
={\left\{\begin{array}{c}H_{\widehat{p}_1}=\{ \langle
\varrho_1,([0.1,0.3],[0.2,0.5]),(0.6,0.3)\rangle, \langle
\varrho_2,([0.5,0.6],[0.3,0.4]),(0.2,0.7)\rangle, \langle \varrho_3,([0.3,0.8],[0.1,0.2]),(0.2,0.7))\rangle \},\\
H_{\widehat{p}_2}=\{ \langle
\varrho_1,([0.3,0.6],[0.2,0.3]),(0.8,0.1)\rangle, \langle
\varrho_2,([0.1,0.4],[0.2,0.6]),(0.3,0.5)\rangle, \langle M\varrho_3,([0.4,0.5],[0.3,0.4]),(0.3,0.6)\rangle \},\\
H_{\widehat{p}_3}=\{ \langle
\varrho_1,([0.1,0.6],[0.2,0.3]),(0.3,0.5)\rangle, \langle
\varrho_2,([0.2,0.5],[0.3,0.5]),(0.1,0.4)\rangle, \langle \varrho_3,([0.1,0.8],[0.1,0.2]),(0.2,0.7)\rangle\},\\
H_{\widehat{p}_4}=\{ \langle
\varrho_1,([0.4,0.5],[0.2,0.4]),(0.1,0.8)\rangle,\langle
\varrho_2,([0.6,0.7],[0.1,0.3]),(0.7,0.1)\rangle, \langle \varrho_3,([0.5,0.8],[0.1,0.2]),(0.4,0.6)\rangle \}\\
\end{array}
\right \}}$$
\end{center}
```
Now, I have also attached a link that will direct anyone to the IEEE Access template (<https://www.overleaf.com/latex/templates/ieee-access-latex-template/cdxrhtbjgszv>).
Please help me adjust these arrays either in the center of the page of in a single column.
Thank you
I have tried changing the sizes of the arrays and also tried to break the arrays but both of the things didn't work.
| https://tex.stackexchange.com/users/296376 | How to fit a long array in IEEE Access Latex two column template? | false | (too long for a comment, hence posted as an answer)
I'm afraid your arrays are simply much too big to be placed in a single column. I've cleaned up the code of the array; its width is more than twice the value of `\columnwidth`. Even after switching to `\tiny` -- for a 50% linear reduction in font size -- the array's width still exceeds `\columnwidth` by far.
I think your only choice is to come up with a radically different approach to displaying the contents of the arrays. E.g., can you break down the components of each row into smaller parts and then show these components individually, instead of showing one long and complicated row?
```
\documentclass[demo]{IEEEaccess} % remove 'demo' option in real doc.
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[1][1-8] % a few lines of filler text
\[
H_{\mathbb{P}} =
\begin{Bmatrix}
H_{\hat{p}_1}=
\langle \varrho_1,([0.3,0.5],[0.1,0.5]),(0.4,0.6)\rangle,
\langle \varrho_2,([0.3,0.4],[0.1,0.5]),(0.4,0.5)\rangle,
\langle \varrho_3,([0.2,0.6],[0.1,0.4]),(0.3,0.6)\rangle,\\
H_{\hat{p}_2}=
\langle \varrho_1,([0.1,0.4],[0.4,0.6]),(0.2,0.7)\rangle,
\langle \varrho_2,([0.2,0.4],[0.5,0.6]),(0.1,0.4)\rangle,
\langle \varrho_3,([0.3,0.8],[0.1,0.2]),(0.6,0.1)\rangle,\\
H_{\hat{p}_3}=
\langle \varrho_1,([0.2,0.6],[0.1,0.3]),(0.2,0.6)\rangle,
\langle \varrho_2,([0.2,0.4],[0.1,0.4]),(0.3,0.5)\rangle,
\langle \varrho_3,([0.1,0.2],[0.3,0.8]),(0.3,0.5)\rangle,\\
H_{\hat{p}_4}=
\langle \varrho_1,([0.1,0.4],[0.3,0.6]),(0.1,0.8)\rangle,
\langle \varrho_2,([0.1,0.5],[0.1,0.3]),(0.3,0.5)\rangle,
\langle \varrho_3,([0.2,0.3],[0.2,0.7]),(0.2,0.4)\rangle \\
\end{Bmatrix}
\]
\lipsum[1][9-12] % more filler text
\bigskip
\tiny
\lipsum[1][1-8] % a few lines of filler text
\[
H_{\mathbb{P}} =
\begin{Bmatrix}
H_{\hat{p}_1}=
\langle \varrho_1,([0.3,0.5],[0.1,0.5]),(0.4,0.6)\rangle,
\langle \varrho_2,([0.3,0.4],[0.1,0.5]),(0.4,0.5)\rangle,
\langle \varrho_3,([0.2,0.6],[0.1,0.4]),(0.3,0.6)\rangle,\\
H_{\hat{p}_2}=
\langle \varrho_1,([0.1,0.4],[0.4,0.6]),(0.2,0.7)\rangle,
\langle \varrho_2,([0.2,0.4],[0.5,0.6]),(0.1,0.4)\rangle,
\langle \varrho_3,([0.3,0.8],[0.1,0.2]),(0.6,0.1)\rangle,\\
H_{\hat{p}_3}=
\langle \varrho_1,([0.2,0.6],[0.1,0.3]),(0.2,0.6)\rangle,
\langle \varrho_2,([0.2,0.4],[0.1,0.4]),(0.3,0.5)\rangle,
\langle \varrho_3,([0.1,0.2],[0.3,0.8]),(0.3,0.5)\rangle,\\
H_{\hat{p}_4}=
\langle \varrho_1,([0.1,0.4],[0.3,0.6]),(0.1,0.8)\rangle,
\langle \varrho_2,([0.1,0.5],[0.1,0.3]),(0.3,0.5)\rangle,
\langle \varrho_3,([0.2,0.3],[0.2,0.7]),(0.2,0.4)\rangle \\
\end{Bmatrix}
\]
\lipsum[1][9-12] % more filler text
\EOD
\end{document}
```
---
*Addendum* to address the OP's follow-up comment. I think you may be best off placing the four large expressions in a `table` in landscape mode on a page all by themselves. Then, refer to the objects from within the text.
```
\documentclass[demo]{IEEEaccess} % remove 'demo' option in real doc.
\usepackage{amsmath,amssymb}
\usepackage{newtxtext,newtxmath}
\usepackage{graphicx}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{lipsum} % for filler text
\begin{document}
\lipsum[1-6] % filler text
\afterpage{ % defer execution until start of next page
\begin{landscape}
\begin{table}
\caption{Some tuples}
\begin{align*}
H_{\mathbb{P}} &=
\begin{Bmatrix}
\begin{aligned}
c H_{\hat{p}_1} &=
\langle \varrho_1,([0.3,0.5],[0.1,0.5]),(0.4,0.6)\rangle,
\langle \varrho_2,([0.3,0.4],[0.1,0.5]),(0.4,0.5)\rangle,
\langle \varrho_3,([0.2,0.6],[0.1,0.4]),(0.3,0.6)\rangle,\\
H_{\hat{p}_2} &=
\langle \varrho_1,([0.1,0.4],[0.4,0.6]),(0.2,0.7)\rangle,
\langle \varrho_2,([0.2,0.4],[0.5,0.6]),(0.1,0.4)\rangle,
\langle \varrho_3,([0.3,0.8],[0.1,0.2]),(0.6,0.1)\rangle,\\
H_{\hat{p}_3} &=
\langle \varrho_1,([0.2,0.6],[0.1,0.3]),(0.2,0.6)\rangle,
\langle \varrho_2,([0.2,0.4],[0.1,0.4]),(0.3,0.5)\rangle,
\langle \varrho_3,([0.1,0.2],[0.3,0.8]),(0.3,0.5)\rangle,\\
H_{\hat{p}_4} &=
\langle \varrho_1,([0.1,0.4],[0.3,0.6]),(0.1,0.8)\rangle,
\langle \varrho_2,([0.1,0.5],[0.1,0.3]),(0.3,0.5)\rangle,
\langle \varrho_3,([0.2,0.3],[0.2,0.7]),(0.2,0.4)\rangle \
\end{aligned}
\end{Bmatrix} \\[3\jot] % a bit more vertical separation
I_{\mathbb{P}} &=
\begin{Bmatrix}
\begin{aligned}
H_{\hat{p}_1} &= \dots \\
H_{\hat{p}_2} &= \dots \\
H_{\hat{p}_3} &= \dots \\
H_{\hat{p}_4} &= \dots \
\end{aligned}
\end{Bmatrix} \\[3\jot]
J_{\mathbb{P}} &=
\begin{Bmatrix}
\begin{aligned}
H_{\hat{p}_1} &= \dots \\
H_{\hat{p}_2} &= \dots \\
H_{\hat{p}_3} &= \dots \\
H_{\hat{p}_4} &= \dots \
\end{aligned}
\end{Bmatrix} \\[3\jot]
R_{\mathbb{P}} &=
\begin{Bmatrix}
\begin{aligned}
H_{\hat{p}_1} &= \dots \\
H_{\hat{p}_2} &= \dots \\
H_{\hat{p}_3} &= \dots \\
H_{\hat{p}_4} &= \dots \
\end{aligned}
\end{Bmatrix}
\end{align*}
\end{table}
\end{landscape}
\clearpage
}
\lipsum[7-19] % more filler text
\EOD
\end{document}
```
| 1 | https://tex.stackexchange.com/users/5001 | 684811 | 317,703 |
https://tex.stackexchange.com/questions/684809 | 3 | The document (and beamer also) includes Kannada as the main language and English as the other language. I am able to generate a document file (through XeLatex) successfully. But when I try to generate a presentation (Beamer). `"Package polyglossia Error: The current latin font NotoSansKannada(0) does not" error is generated.` Help needed in this regard!
(Note: Editor used is: TEXMAKER)
MWE of document (this is successfully getting generated) is given below:
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{polyglossia}
\newfontfamily\kannadafont{Noto Sans Kannada}[Script=Kannada]
\setmainlanguage[numerals=Kannada]{kannada}
\setotherlanguages{english}
\begin{document}
ಇದು ನನ್ನ ಮೊದಲನೆಯ ಕನ್ನಡ ಲೇಟೆಕ್ ಫೈಲ್. ೧ ಮತ್ತು ೨ನೇ ವಿಷಯ ಹೇಗೆ ಬರುತ್ತದೆಯೆಂದು ನೋಡೋಣ.
\textenglish{\textcolor{blue}{\Large This is a testing message}}
\section{ಮುಂದಿನ ಭಾಗ}
ನಾನು ಮೊನ್ನೆ ಮೈಸೂರಿಗೆ ಹೋಗಿದ್ದೆ.
\begin{enumerate}
\item \textcolor{red}{ಮೊದಲನೆಯದ್ದು}
\item \textcolor{blue}{\Huge ಎರಡನೆಯದ್ದು}
\item {\large ಮೂರನೆಯದ್ದು}
\item ನಾಲ್ಕನೆಯದ್ದು
\end{enumerate}
\textenglish{\textcolor{cyan}{\Huge This is another testing message}}
\end{document}
```
MWE of presentation (through beamer) (this is generating error and hence is not able to generate the output) is given below:
```
\documentclass[11pt]{beamer}
\usetheme{default}
\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{polyglossia}
\newfontfamily\kannadafont{Noto Sans Kannada}[Script=Kannada]
\setmainlanguage[numerals=Kannada]{kannada}
\setotherlanguages{english}
\begin{document}
\begin{frame}{First frame}
\begin{block}{First block}
ಇದು ನನ್ನ ಮೊದಲನೆಯ ಕನ್ನಡ ಲೇಟೆಕ್ ಫೈಲ್. ೧ ಮತ್ತು ೨ನೇ ವಿಷಯ ಹೇಗೆ ಬರುತ್ತದೆಯೆಂದು ನೋಡೋಣ.
\textenglish{\textcolor{blue}{\Large This is a testing message}}
\section{ಮುಂದಿನ ಭಾಗ}
ನಾನು ಮೊನ್ನೆ ಮೈಸೂರಿಗೆ ಹೋಗಿದ್ದೆ.
\begin{enumerate}
\item \textcolor{red}{ಮೊದಲನೆಯದ್ದು}
\item \textcolor{blue}{\Huge ಎರಡನೆಯದ್ದು}
\item {\large ಮೂರನೆಯದ್ದು}
\item ನಾಲ್ಕನೆಯದ್ದು
\end{enumerate}
\textenglish{\textcolor{cyan}{\Huge This is another testing message}}
\end{block}
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/35219 | Not able to generate output when Kannada is used in Beamer | true | The difference between the article and beamer class is that beamer normally uses sans serif fonts.
You can specify the fonts for sans serif text like this:
```
% !TeX TS-program = xelatex
\documentclass[11pt]{beamer}
\usetheme{default}
\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{polyglossia}
\newfontfamily\kannadafont{Noto Sans Kannada}[Script=Kannada]
\setsansfont{Noto Sans}
\newfontfamily\kannadafontsf{Noto Sans Kannada}
\setmainlanguage[numerals=Kannada]{kannada}
\setotherlanguages{english}
\begin{document}
\begin{frame}{\textenglish{First frame}}
\begin{block}{\textenglish{First block}}
ಇದು ನನ್ನ ಮೊದಲನೆಯ ಕನ್ನಡ ಲೇಟೆಕ್ ಫೈಲ್. ೧ ಮತ್ತು ೨ನೇ ವಿಷಯ ಹೇಗೆ ಬರುತ್ತದೆಯೆಂದು ನೋಡೋಣ.
\textenglish{\textcolor{blue}{\Large This is a testing message}}
\section{ಮುಂದಿನ ಭಾಗ}
ನಾನು ಮೊನ್ನೆ ಮೈಸೂರಿಗೆ ಹೋಗಿದ್ದೆ.
\begin{enumerate}
\item \textcolor{red}{ಮೊದಲನೆಯದ್ದು}
\item \textcolor{blue}{\Huge ಎರಡನೆಯದ್ದು}
\item {\large ಮೂರನೆಯದ್ದು}
\item ನಾಲ್ಕನೆಯದ್ದು
\end{enumerate}
\textenglish{\textcolor{cyan}{\Huge This is another testing message}}
\end{block}
\end{frame}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/36296 | 684812 | 317,704 |
https://tex.stackexchange.com/questions/684813 | 0 | I want to use the book item of Beamer and text in `\tiny` size, but the text "My book" in the code below seems to be in subscript. There any way to align the book item and the text (without using `\vspace*{}`)?
```
\documentclass[10pt,xcolor={dvipsnames,table}]{beamer}
\mode<article> % only for the article version
{
\usepackage{fullpage}
\usepackage{hyperref}
}
\mode<presentation>
{
%\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
\setbeamercovered{transparent}
\usefonttheme{serif}
\usecolortheme{crane}
}
\setbeamercovered{dynamic}
\setbeamertemplate{items}[circle]
\begin{document}
\begin{frame}
{\tiny {\includegraphics[scale=.75]{beamericonbook}}~My book...}
\end{frame}
\end{document}
```
| https://tex.stackexchange.com/users/295544 | Alignment of book icon in Beamer and text in tiny size | true | You could use the `adjustbox` package to change the vertical alignment of the image.
If you need more fine control, you could use a `\raisebox{...}{...}` to move the image up or down:
```
\documentclass[10pt,xcolor={dvipsnames,table}]{beamer}
\mode<article> % only for the article version
{
\usepackage{fullpage}
\usepackage{hyperref}
}
\mode<presentation>
{
%\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
\setbeamercovered{transparent}
\usefonttheme{serif}
\usecolortheme{crane}
}
\setbeamercovered{dynamic}
\setbeamertemplate{items}[circle]
\usepackage[export]{adjustbox}
\begin{document}
\begin{frame}
{\tiny {\includegraphics[scale=.75,valign=c]{beamericonbook}}~My book...}
{\tiny {\raisebox{-1.2ex}{\includegraphics[scale=.75]{beamericonbook}}}~My book...}
\end{frame}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/36296 | 684814 | 317,705 |
https://tex.stackexchange.com/questions/684769 | 6 |
```
\documentclass{article}
\usepackage{xstring}
\begin{document}
\StrBehind[2]{/foo/bar}{/}
\StrCount{/foo/bar}{/}
\StrBehind[\StrCount{/foo/bar}{/}]{/foo/bar}{/}
\end{document}
```
I'm trying to delete `/foo/` out of `/foo/bar` using `xstring`. The first line in the document above does produce `bar` and the second line does produce `2`, but the third line doesn't work. How do I make it work, or is there a simpler approach to do what I want?
| https://tex.stackexchange.com/users/171866 | Delete string up to last slash | false | Here is a another approach using underlying TeX capacity with delimited macros. Compared to [answer by wipet](https://tex.stackexchange.com/a/684771/293669) it is not using conditional tests (which may fail fo various reasons such as braced material, I will give an example), but it also proceeds iteratively and expandably.
```
\documentclass{article}
\usepackage[T1]{fontenc}% for \texttt{->}
\makeatletter
\catcode`A 3 % create some improbable token as delimiter
% as we are using LaTeX for the demo, perhaps
% we should have used \@nil
% switch utility
\long\def\uppera@switch #1A#2#3\relax{#2}
% we incorporate slight overhead to expand in exactly two steps
\long\def\afterlastslash#1{\romannumeral\afterlastslash@i \z@#1/A}
\long\def\afterlastslash@i #1/#2{\uppera@switch #2{#1}A{\afterlastslash@i\z@#2}\relax}
\catcode`A 11
\makeatother
\begin{document}
\newcommand\test[1]{\texttt{\detokenize{\afterlastslash{#1}}} expands to \texttt{\afterlastslash{#1}}}
\test{/oof/bar} % expands to bar
\test{/{oof}/bar} % expands to bar
\test{{braced/path}/bar} % expands to bar
\test{{/path}/bar} % expands to bar
\test{/foo/bar/next} % expands to next
\newcommand\testedef[1]{\texttt{\detokenize{\edef\x{\afterlastslash{#1}}}} gives meaning
\edef\x{\afterlastslash{#1}}\texttt{\meaning\x<after meaning>}}
\testedef{/foo/bar/next}
\testedef{/foo/bar/next/}
Check that two expansions suffice
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter\x
\expandafter\expandafter\expandafter{\afterlastslash{/foo/bar/next}}
\texttt{\meaning\x<after meaning>}
Show feature of brace removal of output
% a limitation: there is brace removal of last part
\edef\x{\afterlastslash{/foo/bar/{next}}}\texttt{\meaning\x<after meaning>}
Check nesting. We need te expand argument, but our macro was not constructed
to expand it. So let's use \texttt{\string\expanded} and
\texttt{\string\expandafter}.
\begin{verbatim}
\edef\x{\expandafter\afterlastslash\expandafter{%
\expanded{\afterlastslash{/foo/bar/{/foo/bar}}}}}
\end{verbatim}
%
\edef\x{\expandafter\afterlastslash\expandafter{\expanded{\afterlastslash{/foo/bar/{/foo/bar}}}}}\texttt{\meaning\x<after meaning>}
\end{document}
```
#### Variant which makes sure to protect output from brace removal:
```
\documentclass{article}
\usepackage[T1]{fontenc}% for \texttt{->}
\makeatletter
\catcode`A 3 % create some improbable token as delimiter
% as we are using LaTeX for the demo, perhaps
% we should have used \@nil
% switch utility
\long\def\uppera@switch #1A#2#3\uppera@switch{#2}
% we incorporate slight overhead to expand in exactly two steps
% also we avoid brace removal of last item in this variant
% (thanks to extending it by \@nil and also by fetching two
% items at a time)
\long\def\afterlastslash#1{\romannumeral\afterlastslash@i#1\@nil/A/}
\long\def\afterlastslash@i #1/#2/{%
% notice that brace removal can happen in intermediate #2 but this
% is not important, as the final "basename" is protected by the added \@nil
\uppera@switch #2{\afterlastslash@clean\@empty#1}A{\afterlastslash@i#2/}\uppera@switch
}
% \@empty token will prevent brace removal in this last step
\long\def\afterlastslash@clean#1\@nil{\expandafter\z@#1}
\catcode`A 11
\makeatother
% wipet https://tex.stackexchange.com/a/684771/293669
% \def\afterlastslash#1{\afterlsA#1/\end}
% \def\afterlsA#1/#2{\ifx#2\end #1\else \expandafter\afterlsA\expandafter#2\fi}
\begin{document}
\newcommand\test[1]{\texttt{\detokenize{\afterlastslash{#1}}} expands to \texttt{\afterlastslash{#1}}}
\test{/oof/bar} % expands to bar
\test{/{oof}/bar} % expands to bar
\test{{braced/path}/bar} % expands to bar
\test{{/path}/bar} % expands to bar
\test{/foo/bar/next} % expands to next
\newcommand\testedef[1]{\texttt{\detokenize{\edef\x{\afterlastslash{#1}}}} gives meaning
\edef\x{\afterlastslash{#1}}\texttt{\meaning\x<after meaning>}}
\testedef{/foo/bar/next}
\testedef{/foo/bar/next/}
Check that two expansions suffice
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter\x
\expandafter\expandafter\expandafter{\afterlastslash{/foo/bar/next}}
\texttt{\meaning\x<after meaning>}
Check no brace removal regarding last item
\edef\x{\afterlastslash{/foo/bar/{last is kept braced}}}\texttt{\meaning\x<after meaning>}
\end{document}
```
output
| 2 | https://tex.stackexchange.com/users/293669 | 684815 | 317,706 |
https://tex.stackexchange.com/questions/684818 | 3 | I use `pdfLaTeX` and `\usepackage{times}` for my document and cannot understand why there is no bold text in my document. I tried to use `\rmfamily` (it works), but it is not the same, right?)
if somebody know way to write bold and use times-a-like font please let me know
```
\documentclass[a4paper,14pt]{extarticle}
\usepackage[a4paper, left=25mm, right=10mm, top=20mm, bottom=20mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian,ukrainian]{babel}
\usepackage{times}
\begin{document}
\textbf{qqqqq}
\end{document}
```
| https://tex.stackexchange.com/users/217087 | Bold text with times package and pdfLaTeX | false | Use a font that has a T2A encoding, `times` doesn't has it! Use for example `libertine` instead of `times`:
```
\usepackage{libertine}
```
| 2 | https://tex.stackexchange.com/users/187802 | 684821 | 317,707 |
https://tex.stackexchange.com/questions/684769 | 6 |
```
\documentclass{article}
\usepackage{xstring}
\begin{document}
\StrBehind[2]{/foo/bar}{/}
\StrCount{/foo/bar}{/}
\StrBehind[\StrCount{/foo/bar}{/}]{/foo/bar}{/}
\end{document}
```
I'm trying to delete `/foo/` out of `/foo/bar` using `xstring`. The first line in the document above does produce `bar` and the second line does produce `2`, but the third line doesn't work. How do I make it work, or is there a simpler approach to do what I want?
| https://tex.stackexchange.com/users/171866 | Delete string up to last slash | false | with `lualatex`
```
\documentclass{article}
\usepackage{luacode}
\begin{luacode}
function StrBehind(s0)
local s1 = s0:split("/")
tex.print(s1[#s1])
end
\end{luacode}
\newcommand\StrBehind[1]{\directlua{StrBehind("#1")}}
\begin{document}
\StrBehind{/foo/bar}
\StrBehind{/foo/bar/bza/foobar}
\StrBehind{foobar}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/187802 | 684823 | 317,708 |
https://tex.stackexchange.com/questions/684818 | 3 | I use `pdfLaTeX` and `\usepackage{times}` for my document and cannot understand why there is no bold text in my document. I tried to use `\rmfamily` (it works), but it is not the same, right?)
if somebody know way to write bold and use times-a-like font please let me know
```
\documentclass[a4paper,14pt]{extarticle}
\usepackage[a4paper, left=25mm, right=10mm, top=20mm, bottom=20mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian,ukrainian]{babel}
\usepackage{times}
\begin{document}
\textbf{qqqqq}
\end{document}
```
| https://tex.stackexchange.com/users/217087 | Bold text with times package and pdfLaTeX | true | You want a Times clone that also supports Cyrillic: Tempora.
```
\documentclass[a4paper,14pt]{extarticle}
\usepackage[a4paper, left=25mm, right=10mm, top=20mm, bottom=20mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian,ukrainian]{babel}
\usepackage{tempora}
\begin{document}
\textbf{qqqqq}
Київ \textbf{Київ}
abcdefghijklmnopqrstuvwxyz (Tempora)
{\fontencoding{T1}\fontfamily{ptm}\selectfont
abcdefghijklmnopqrstuvwxyz (Times)}
\end{document}
```
Why didn't you get boldface? If you look in the log file, you'll see
```
LaTeX Font Warning: Font shape `T2A/ptm/m/n' undefined
(Font) using `T2A/cmr/m/n' instead on input line 9.
LaTeX Font Warning: Font shape `T2A/ptm/b/n' undefined
(Font) using `T2A/ptm/m/n' instead on input line 11.
```
The `ptm` font family doesn't support the T2A (Cyrillic) encoding, so a substitution with the default font family is performed. Next, LaTeX realizes you want `b` (bold face) and substitutes the only font in the family `ptm` with encoding T2A it know (which is actually the substitute, so Computer Modern Cyrillic in medium series).
| 3 | https://tex.stackexchange.com/users/4427 | 684824 | 317,709 |
https://tex.stackexchange.com/questions/681876 | 0 | I want to cite lecture slides using IEEE style as described here: <https://libraryguides.vu.edu.au/ieeereferencing/lecturenotes>
The lecture notes are here: <http://cs231n.stanford.edu/slides/2017/cs231n_2017_lecture11.pdf>
How to include this in LaTeX?
| https://tex.stackexchange.com/users/294424 | How to cite lecture slides? | false | You didn't give enough details to answer.
According to [How to Use the IEEEtran BiBTeX Style](https://ctan.mirror.garr.it/mirrors/ctan/macros/latex/contrib/IEEEtran/bibtex/IEEEtran_bst_HOWTO.pdf):
>
> IEEEtran.bst provides the electronic entry type for internet
> references. IEEEtran.bst also provides the aliases “online”,
> “internet”, “webpage” and “www” for compatibility with some existing
> BiBTeX database and style files. However, “electronic” (or perhaps
> “online” for those who also use Philipp Lehman’s `biblatex`) should be
> used for all new work. The IEEE formats electronic references
> differently by not using italics or quotes and separating fields with
> periods rather than commas. Also, the date is enclosed within
> parentheses and is placed closer to the title. This is probably done
> to emphasize that electronic references may not remain valid on the
> rapidly changing internet. Note also the liberal use of the
> howpublished field to describe the form or category of the entries.
> The organization and address fields may also be used.
>
>
>
Supposing you're using `IEEEtran` document class, here is an example:
```
\begin{filecontents}{ref.bib}
@online{li2017,
author = {Fei-Fei Li and Justin Johnson and Serena Yeung},
title = {{Lecture 11: Detection and Segmentation}},
url = {http://cs231n.stanford.edu/slides/2017/cs231n_2017_lecture11.pdf},
howpublished={PDF document},
year = {2017}
}
@article{duck2023,
author = {Paulinho van Duck and Paulette de la Quack},
title = {{Ducks are smart}},
journal={{Quack University Journal}},
volume={1},
number={3},
year = {2023}
}
\end{filecontents}
\documentclass[american]{IEEEtran}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{xurl}
\begin{document}
Lecture note: \cite{li2017}.
Ordinary article: \cite{duck2023}.
\bibliographystyle{IEEEtran}
\bibliography{ref}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/101651 | 684825 | 317,710 |
https://tex.stackexchange.com/questions/684820 | 1 | Is it possible to change the semicolon in LNI alpha style if multiple publications are referenced? Instead of [AB01;AB02] to [AB01,AB02].
I am using `biblatex`, and `biber`, together with the LNI style.
| https://tex.stackexchange.com/users/277641 | LNI/alpha change abbreviation of multiple citations | false | For anyone intereseted, add this line after your biblatex package:
```
\renewcommand*{\multicitedelim}{\addcomma\space}
```
| 1 | https://tex.stackexchange.com/users/277641 | 684839 | 317,715 |
https://tex.stackexchange.com/questions/684828 | 0 | I am having an issue implementing the \pgfkeys command for a marco I want to compile. Here is the code. Please let me know what went wrong:
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{pgfkeys}
%Dictionaries
\pgfkeys{%
/attention/.is family, /attention,
%Here are the defaults
default/.style = {
text size = \large,
text style = \bfseries,
text colour = green,
},
%store the defaults in a command
text size/.store in =\txtsize,
text style/.store in = \txtstyle,
text colour/.store in =\txtcolour,
}%
%Macro
\newcommand{\attention}[2][]{%
\pgfkeys{/attention, default, #1}
{\txtsize\txtstyle\textcolor{\txtcolour}{#2}}
}%
\title{}
\begin{document}
\maketitle
So we are...\attention{Let's get this macro started}... shall we?
\end{document}
```
| https://tex.stackexchange.com/users/296394 | Using \pgfkeys for Macros | false | Remove the blank line in `\pgfkeys`...
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{pgfkeys}
% Dictionaries
\pgfkeys{%
/attention/.is family,
/attention,
% Here are the defaults
default/.style = {
text size = \large,
text style = \bfseries,
text colour = green,
},
% store the defaults in a command
text size/.store in =\txtsize,
text style/.store in = \txtstyle,
text colour/.store in =\txtcolour,
}
% Macro
\newcommand{\attention}[2][]{%
\pgfkeys{/attention, default, #1}%
{\txtsize\txtstyle\textcolor{\txtcolour}{#2}}%
}
\title{}
\begin{document}
\maketitle
So we are...\attention{Let's get this macro started}... shall we?
\end{document}
```
| 2 | https://tex.stackexchange.com/users/14500 | 684841 | 317,717 |
https://tex.stackexchange.com/questions/684827 | 1 | I am using overleaf to write my document. Here is my pre-amble:
```
\documentclass[12pt]{report}
\usepackage[english]{babel}
\usepackage{appendix}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subfig}
\graphicspath{ {./images/} }
\usepackage{float}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[left=2cm, right=2cm]{geometry} %this is the margin size.
\setlength {\marginparwidth }{2cm} %confirming the margin width for todonotes?
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{url}
\bibliographystyle{ieeetr}
\usepackage[toc,page]{appendix}
\begin{document}
```
Then I want to have the bibliography near the end of my document, so I scroll down to where I want it, and this is what I have:
```
\newpage
\addcontentsline{toc}{section}{References}
\bibliographystyle{ieetr}
\bibliography{bib}
\newpage
%TC:ignore
\begin{appendices}
```
(I want the bibliography to come before the appendices). However, when I compile the document, my references are printed without the url. Here is an example of one of the references I have put into my bib.bib:
```
@article{TLD_variance,
author={ANDREW MATACZ},
year={2000},
month={Jan},
title={FINANCIAL MODELING AND OPTION THEORY WITH THE TRUNCATED LEVY PROCESS},
journal={International journal of theoretical and applied finance},
volume={3},
number={1},
pages={143-160},
abstract={In recent studies the truncated Levy process (TLP) has been shown to be very promising for the modeling of financial dynamics. In contrast to the Levy process, the TLP has finite moments and can account for both the previously observed excess kurtosis at short timescales, along with the slow convergence to Gaussian at longer timescales. In this paper I further test the truncated Levy paradigm using high frequency data from the Australian All Ordinaries share market index. I then consider an optimal option hedging strategy which is appropriate for the early Levy dominated regime. This is compared with the usual delta hedging approach and found to differ significantly.},
isbn={0219-0249},
url={http://www.worldscientific.com/doi/abs/10.1142/S0219024900000073},
doi={10.1142/S0219024900000073}
}
```
But when compiled, it is printed like this:
```
[48] A. MATACZ, “Financial modeling and option theory with the truncated levy process,” Interna-
tional journal of theoretical and applied finance, vol. 3, pp. 143–160, Jan 2000.
32
```
How can I get it to also display the url in the reference, and how can I make it so that if someone clicks the reference number in the main text, it will bring them to the specific reference in the bibliography?
Apologies if the code is messy, this is my first time using LaTeX for such a large document.
| https://tex.stackexchange.com/users/296395 | Why are my biblography/references not showing the URLs | false | You asked,
>
> how can I make it so that if someone clicks the reference number in the main text, it will bring them to the specific reference in the bibliography?
>
>
>
Be sure to load the `hyperref` package.
>
> How can I get it to display the `url` field in the reference?
>
>
>
Don't employ the `ieeetr` bib style, which is almost prehistorically old by now and dates back to an age long before URL strings were even conceived of. Instead, I suggest you employ the `IEEEtran` bib style. Its vintage is much more recent than that of `ieeetr`; as a result, it has been programmed to know what to do if an entry has a field called `url`.
By the way, I can see no good reason for ALL-UPPERCASING the contents of the `author` field; hence, please replace `author={ANDREW MATACZ},` with `author = {Andrew Matacz},`. Ditto for the `title` field. I'd further replace `month={Jan},` with `month=jan`.
```
\documentclass[12pt]{report}
\begin{filecontents}[overwrite]{bib.bib}
@article{TLD_variance,
author = {Andrew Matacz},
year = {2000},
month = jan,
title = {Financial modeling and option theory with the truncated {Levy} process},
journal = {International Journal of Theoretical and Applied Finance},
volume = {3},
number = {1},
pages = {143-160},
abstract = {...},
isbn = {0219-0249},
url = {http://www.worldscientific.com/doi/abs/10.1142/S0219024900000073},
doi = {10.1142/S0219024900000073}
}
\end{filecontents}
\usepackage[english]{babel}
%%\usepackage{appendix} % don't load packages more than once
%%%\usepackage[utf8x]{inputenc} % nooooooo !
\usepackage{amsmath}
\usepackage{graphicx}
%\usepackage{subfig} % don't load both 'subfig' and 'subcaption'
\graphicspath{ {./images/} }
\usepackage{float} % <-- are you sure?
\usepackage{caption}
\usepackage{subcaption}
\usepackage[hmargin=2cm]{geometry} % horizontal margins
\setlength {\marginparwidth }{2cm} %confirming the margin width for todonotes?
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{xurl} % better use 'xurl', not 'url'
\bibliographystyle{IEEEtran}
\usepackage[toc,page]{appendix}
\usepackage{ragged2e} % <-- new
\frenchspacing % optional
\begin{document}
\nocite{*}
\RaggedRight
\addcontentsline{toc}{section}{References}
\bibliography{bib}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/5001 | 684850 | 317,720 |
https://tex.stackexchange.com/questions/684845 | 1 | I am trying to use `{\renewcommand{\addvspace}[1]{} \listoffigures}` to remove spaces between figure captions of two different chapters in the list of figures.
`{\renewcommand{\addvspace}[1]{} \listoffigures}` works fine when defined in the main .tex file. But fails to work when put into the .cls file. I am getting a compilation error.
How do I define this in the .cls file.
TLDR;
`{\renewcommand{\addvspace}[1]{} \listoffigures}` does not work in the permeable. What is the correct syntax to define the above in the permeable.
| https://tex.stackexchange.com/users/296407 | How to define {\renewcommand{\addvspace}[1]{} \listoffigures} in .cls file | false | I think you are referring to getting rid of the effect of this in `.lof` file:
```
\addvspace {10\p@ }
\contentsline {figure}{\numberline {1.1}{\ignorespaces first figure}}{3}{}%
\addvspace {10\p@ }
\contentsline {figure}{\numberline {2.1}{\ignorespaces second figure}}{5}{}%
```
I used this input:
```
\documentclass{book}
\begin{document}
\listoffigures
\chapter{One}
\begin{figure}[htbp]
\centering
some graphics
\caption{first figure}
\label{fig:1}
\end{figure}
\chapter{Two}
\begin{figure}[htbp]
\centering
some graphics
\caption{second figure}
\label{fig:2}
\end{figure}
\end{document}
```
The simplest way to obtain what you desire is
```
\begingroup
\renewcommand\addvspace[1]{}
\listoffigures
\endgroup
```
However `\addvspace` is used by many LaTeX constructs so it has to be tested in your real life case. Naturally, the scope of the change is limited via `\begingroup/\endgroup`.
Output:
| 0 | https://tex.stackexchange.com/users/293669 | 684851 | 317,721 |
https://tex.stackexchange.com/questions/684845 | 1 | I am trying to use `{\renewcommand{\addvspace}[1]{} \listoffigures}` to remove spaces between figure captions of two different chapters in the list of figures.
`{\renewcommand{\addvspace}[1]{} \listoffigures}` works fine when defined in the main .tex file. But fails to work when put into the .cls file. I am getting a compilation error.
How do I define this in the .cls file.
TLDR;
`{\renewcommand{\addvspace}[1]{} \listoffigures}` does not work in the permeable. What is the correct syntax to define the above in the permeable.
| https://tex.stackexchange.com/users/296407 | How to define {\renewcommand{\addvspace}[1]{} \listoffigures} in .cls file | false | **EDIT: Please check @DavidCarlisle comments below and just don't do it**
**Comment into answer:**
Add in your preamble or in the cls file these lines :
```
\let\originallistoffigures\listoffigures
\renewcommand{\listoffigures}{{\def\addvspace##1{}\originallistoffigures}}
```
Good luck! Happy that worked for you! and Happy TeXing!
| 1 | https://tex.stackexchange.com/users/120578 | 684856 | 317,723 |
https://tex.stackexchange.com/questions/672312 | 2 | I'm writing a document that cites emails, and I'm trying to use a .bib file to manage the emails that I cite.
How can I modify the cite commands `\citet{Smith:2023aa}` or `\citep{Smith:2023aa}`, or how can I create a custom cite command, to produce in-line citations that appear as "Smith (February 28, 2023)" or "(Smith, February 28, 2023)" in my document?
I am not picky about the specific formatting of the date shown in the document, so long as day, month, and year are shown in-line.
MWE:
```
\documentclass{article}
\begin{filecontents*}{\jobname.bib}
@misc{Smith:2020aa,
title = {Subject: Minimum Working Example}
author = {John Smith},
date = {2020-02-28}
}
\end{filecontents*}
\usepackage[
style=apa,
labeldate=comp,
dateabbrev= false,
natbib,
backend=biber,
]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
\citet{Smith:2020aa}
\printbibliography
\end{document}
```
Thanks for your advice on this!
| https://tex.stackexchange.com/users/132943 | modify or create cite commands like \citet{} or \citep{} that show day, month, and year in-line | true | Here I created `\citewithdatep`, that prints (Author, Month Day, Year), and `\citewithdatet`, that prints Author (Month Day, Year):
```
\documentclass{article}
\begin{filecontents*}{\jobname.bib}
@misc{Smith:2020aa,
title = {Subject: Minimum Working Example},
author = {John Smith},
date = {2020-02-28}
}
\end{filecontents*}
\usepackage[
style=apa,
labeldate=comp,
dateabbrev= false,
natbib,
backend=biber,
]{biblatex}
\DeclareCiteCommand{\citewithdatep}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}}
{\mkbibparens{%
\printnames{labelname}%
\addcomma\addspace%
\printfield{month}%
\addspace%
\printfield{day}%
\addcomma\addspace%
\printfield{year}%
}%
}
{\multicitedelim}
{}
\DeclareCiteCommand{\citewithdatet}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}}
{\printnames{labelname}%
\addspace%
\mkbibparens{%
\printfield{month}%
\addspace%
\printfield{day}%
\addcomma\addspace%
\printfield{year}%
}%
}
{\multicitedelim}
{}
\addbibresource{\jobname.bib}
\begin{document}
This is an email citation in the format (Author, Month Day, Year):
\citewithdatep{Smith:2020aa}
This is an email citation in the format Author (Month Day, Year):
\citewithdatet{Smith:2020aa}
This is an ordinary citation
\citet{Smith:2020aa}
\printbibliography
\end{document}
```
| 1 | https://tex.stackexchange.com/users/101651 | 684862 | 317,727 |
https://tex.stackexchange.com/questions/684848 | 0 | This is the minimal example for my question:
I want to convert one element of a `clist` to `int` to be able to pass them to another function. This breaks with `undefined control sequence`. What am I doing wrong?
```
\documentclass{scrlttr2}
\ExplSyntaxOn
\NewDocumentCommand{\hours}{m}
{
\fp_eval:n { #1 / 60 } h
}
\NewDocumentCommand{\strtime}{mm}
{
\clist_clear_new:N \l__timelist_testing_clist
\clist_put_right:Nn \l__timelist_testing_clist { #1 * 60 }
\l__timelist_testing_clist \\
\fp_eval:n { \clist_item:nn { \l__timelist_testing_clist } {1} } \\
\fp_eval:n { round( \fp_eval:n { \clist_item:nn { \l__timelist_testing_clist } {1} }) } \\
\int_set:Nn \l__timecalc_time_minutes_testing_int
{ \fp_eval:n { round( \fp_eval:n { \clist_item:nn { \l__timelist_testing_clist } {1} }) } }
\hours{ \l__timecalc_time_minutes_testing_int }
}
\ExplSyntaxOff
\begin{document}
new:
\strtime{2}{h}
\end{document}
```
================================================================
To understand why I want to do this now the full example:
With valuable help from here I was able to create a few functions for summing up time values in different units (h, d, min) and then display that sum in a useful way.
Also I was able to calculate the median from a `clist` of time values from different units (as above) and return it.
What I was not able to make work is to use the same functionality to then display the resulting median value (in minutes) in a useful way as with the sum.
Somehow I am not able to convert the `clist` variable that is the output of the median function to an integer to make it possible to work as a valid input for the function that displays that minute value in useful ways...
```
\documentclass{scrlttr2}
\ExplSyntaxOn
\NewDocumentCommand{\newtime}{m}
{
\fp_new:c { g__timecalc_time_#1_fp }
\fp_new:c { g__timecalc_factor_#1_fp} % factor to divide the result by after the table
}
\newtime{default} % initialize one
% \addtime* will also show the added time
\NewDocumentCommand{\addtime}{sO{default}mm}
{
\timecalc_time_add:nnn { #2 } { #3 } { #4 }
% with \addtime* also show what's been added
\IfBooleanT{#1}{#3\,\textup{#4}}
}
% show the result of the sum in g__timecalc_time_#1_fp with biggest unit being #2
\NewDocumentCommand{\strtime}{O{default}m}
{
\timecalc_time_str:nn { #1 } { #2 }
}
\int_new:N \l__timecalc_time_days_int
\int_new:N \l__timecalc_time_hours_int
\int_new:N \l__timecalc_time_minutes_int
% add the given time #2 with given unit #3 to __timecalc_time_#1_fp
\cs_new_protected:Nn \timecalc_time_add:nnn
{
\str_case:nnF { #3 }
{
{h}{ \fp_gadd:cn { g__timecalc_time_#1_fp } { #2 * 60 } }
{d}{ \fp_gadd:cn { g__timecalc_time_#1_fp } { #2 * 60 * 24 } }
{min}{ \fp_gadd:cn { g__timecalc_time_#1_fp } { #2 } }
}
{\ERROR}
}
% calculate #1 = #1 / #2 and return the modulo in #3
\cs_new_protected:Nn \timecalc_int_div_mod:nnn {
\int_set:Nn #3
{ \int_div_truncate:nn { #1 } { #2 } }
\int_set:Nn #1
{ \int_mod:nn { #1 } { #2 } }
}
% round the sum in g__timecalc_time_#1_fp and show value with biggest unit being #2
\cs_new_protected:Nn \timecalc_time_str:nn
{
% round to full minutes
\int_set:Nn \l__timecalc_time_minutes_int
{ \fp_eval:n { round( \fp_use:c { g__timecalc_time_#1_fp }, 0 ) } }
\timecalc_time_strshow:nn \l__timecalc_time_minutes_int { #2 }
}
% show the value of \l__timecalc_time_minutes_int with biggest unit being #2
\cs_new_protected:Nn \timecalc_time_strshow:nn
{
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{d}
}
{%yes
% compute and remove the number of days
\timecalc_int_div_mod:nnn{\l__timecalc_time_minutes_int}{1440}{\l__timecalc_time_days_int}
% now print the days
\int_compare:nTF { \l__timecalc_time_days_int > 0 }
{ \int_eval:n { \l__timecalc_time_days_int }\,\textup{d}\; }
{
\unkern
}
}{} % no
\bool_if:nTF
{
\str_if_eq_p:nn{#2}{h} ||
\str_if_eq_p:nn{#2}{d}
}
{% yes
% compute and remove the number of hours
\timecalc_int_div_mod:nnn{\l__timecalc_time_minutes_int}{60}{\l__timecalc_time_hours_int}
% now print the hours
\int_compare:nTF { \l__timecalc_time_hours_int > 0 }
{
\int_eval:n { \l__timecalc_time_hours_int }\,\textup{h}\;
}
{% no hours
\unkern
}
}{} % no
% now print the minutes
\int_compare:nTF { \l__timecalc_time_minutes_int > 0 }
{
\int_eval:n { \l__timecalc_time_minutes_int }\,\textup{min}
}
{% no minutes
\unkern
}
}
% =====================
% time list and median calculations
% show the median of the clist in #1
\NewDocumentCommand{\listmedian}{m}
{
\timelist_median:x { #1 }
}
\clist_new:N \l__timelist_median_clist
\int_new:N \l__timelist_median_int
\cs_new_protected:Nn \timelist_median:n
{
% set a comma separated list
\clist_set:Nn \l__timelist_median_clist { #1 }
% sort it numerically
\clist_sort:Nn \l__timelist_median_clist
{
\fp_compare:nTF { ##1 > ##2 }
{ \sort_return_swapped: }
{ \sort_return_same: }
}
% compute the number of items
\int_set:Nn \l__timelist_median_int { \clist_count:N \l__timelist_median_clist }
\int_if_odd:nTF {\l__timelist_median_int }
{% if the number is odd, return the middle item
\clist_item:Nn \l__timelist_median_clist { (\l__timelist_median_int + 1)/2 }
}
{% otherwise the average of the middle two elements
\fp_eval:n
{
(
\clist_item:Nn \l__timelist_median_clist { \l__timelist_median_int/2 }
+
\clist_item:Nn \l__timelist_median_clist { \l__timelist_median_int/2 + 1 }
)/2
}
}
}
\cs_generate_variant:Nn \timelist_median:n { x }
\clist_clear_new:N \g__timelist_median_clist
\NewDocumentCommand{\addtimelist}{sO{default}mm}
{
\str_case:nnF { #4 }
{
{h}{ \clist_gput_right:Nn { \g__timelist_median_clist } { #3 * 60 } }
{d}{ \clist_gput_right:Nn { \g__timelist_median_clist } { #3 * 60 * 24 } }
{min}{ \clist_gput_right:Nn { \g__timelist_median_clist } { #3 } }
}
{
%\ERROR
}
\IfBooleanT{#1}{#3\,\textup{#4}}
}
\NewDocumentCommand{\timelistmedian}{O{default}}
{
\listmedian{ \g__timelist_median_clist }
}
% should show the
\NewDocumentCommand{\strtimelist}{O{default}m}
{
\listmedian{ \g__timelist_median_clist }
% ========================================================
% the code from here breaks
% round to full minutes
% \int_set:Nn \l__timecalc_time_minutes_int
% { \fp_eval:n { round( \fp_use:x { \listmedian{ \g__timelist_median_clist } }, 0 ) } } % cannot use clist as input for median?
%
% \int_eval:N \l__timecalc_time_minutes_int
%\timecalc_time_strshow:nn \l__timecalc_time_minutes_int { #2 }
}
\ExplSyntaxOff
\begin{document}
addtime:
\addtime*{4}{min}
\addtime*{5}{h}
sum =
\strtime{h}
\strtime{min}
\bigskip
addtimelist:
\addtimelist*{4}{min}
\addtimelist*{5}{h}
\timelistmedian
median = \strtimelist{h}
\end{document}
```
I want the result of `\strtimelist{h}` to be `2 h 32 min` (152 min (median of 4 min and 5 h) converted into h and min) like with `\strtime`
| https://tex.stackexchange.com/users/281557 | How to pass one element of a clist as an int argument for another function? | true |
```
! Undefined control sequence.
<argument> \l__timecalc_time_minutes_testing_int
l.27 \strtime{2}{h}
?
```
so declare the variable
```
\int_new:N \l__timecalc_time_minutes_testing_int
```
then no error reported but
```
\clist_put_right:Nn { \l__timelist_testing_clist } { #1 * 60 }
```
should be
```
\clist_put_right:Nn \l__timelist_testing_clist { #1 * 60 }
```
then
```
\fp_eval:n { \l__timelist_testing_clist }
```
is passing the entire list to `fpeval` which accidentally works as there is only one item, but if there are never more than one item, why use a list?
perhaps change to
```
\clist_put_right:Nx \l__timelist_testing_clist {\fp_eval:n{ #1 * 60} }
```
then you get
```
! Missing number, treated as zero.
```
as you have
```
\clist_item:nn { \l__timelist_testing_clist }
```
to select an item from a list but are missing an argument to say which item
perhaps
```
\clist_item:nn { \l__timelist_testing_clist } {1}
```
this runs without error producing
but I have no idea if that is the intended output
```
\documentclass{scrlttr2}
\ExplSyntaxOn
\int_new:N \l__timecalc_time_minutes_testing_int
\NewDocumentCommand{\strtime}{mm}
{
\clist_clear_new:N \l__timelist_testing_clist
\clist_put_right:Nx \l__timelist_testing_clist {\fp_eval:n{ #1 * 60} }
% round to full minutes
\int_set:Nn \l__timecalc_time_minutes_testing_int
{ \fp_eval:n { round( \clist_item:nn { \l__timelist_testing_clist } {1} ) } }
\int_eval:n{\l__timecalc_time_minutes_testing_int}
%\strtimegen [ \l__timecalc_time_minutes_testing_int ] {#2}
}
\ExplSyntaxOff
\begin{document}
new:
\strtime{2}{h}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/1090 | 684863 | 317,728 |
https://tex.stackexchange.com/questions/130158 | 2 | I am writing a paper with the `IEEEtran` conference document class, a skeleton of which is shown below.
```
\documentclass[conference, a4paper]{IEEEtran}
\begin{document}
\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,library}
\end{document}
```
The reviewers insist on the following conditions in the reference list.
1. No italic fonts in the reference text, neither in the article title, nor in the journal name.
2. Month and year of references must appear before the page numbers (for conference proceedings and journal articles).
I have tried several bib styles including `IEEETran`, `amsplain`, `unsrt`, `apa` and some others, but none of them is meeting the criteria. The `acm` style nearly does the job, but it prints the authors' names in small caps which I don't think will be acceptable in a technical proceeding. Any suggestion on any new bib style or whether it's possible to tweak any existing style to meet the requirements?
| https://tex.stackexchange.com/users/34475 | Proper Bibliography Style | false | The comments on your question should serve you well. However, if you reach an impasse and need to make the two changes that you described, here is how you can do it.
1. Save a copy of `IEEEtran.bst` in the same directory as your main TeX file and make the following changes in it. The latest version as of this post is version 1.14 (2015/08/26).
2. Find
```
FUNCTION {emphasize}
{ duplicate$ empty$
{ pop$ "" }
{ "\emph{" swap$ * "}" * }
if$
}
```
...and replace it with `FUNCTION {emphasize}{}`. This will prevent formatting any portion of your references list in italics.
3. It looks like `IEEEtran.bst` has two entry types that place the date after the pages: `@article` and `@misc`. It appears that `@inproceedings` already has the date before the pages.
In `FUNCTION {article}`, find these two lines:
```
format.pages output
format.date "year" output.warn
```
...and swap their order to put the date before the pages.
In `FUNCTION {misc}`, find these two lines:
```
format.pages output
format.date output
```
...and swap their order to put the date before the pages.
4. Re-compile/typeset your work, including running BibTeX again to capture these changes to the .bst file.
| 0 | https://tex.stackexchange.com/users/263901 | 684864 | 317,729 |
https://tex.stackexchange.com/questions/684845 | 1 | I am trying to use `{\renewcommand{\addvspace}[1]{} \listoffigures}` to remove spaces between figure captions of two different chapters in the list of figures.
`{\renewcommand{\addvspace}[1]{} \listoffigures}` works fine when defined in the main .tex file. But fails to work when put into the .cls file. I am getting a compilation error.
How do I define this in the .cls file.
TLDR;
`{\renewcommand{\addvspace}[1]{} \listoffigures}` does not work in the permeable. What is the correct syntax to define the above in the permeable.
| https://tex.stackexchange.com/users/296407 | How to define {\renewcommand{\addvspace}[1]{} \listoffigures} in .cls file | false | You should not redefine `\addvspace`
The list of figures code is not defined by latex, it is defined by the class, ie *your* file. If you do not want space between captions in different chapters, simply do not add the space, don't add the space command then risk breaking latex by redefining its core commands to do nothing,
For example if your class has
```
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
%%%%%%%\addtocontents{lof}{\protect\addvspace{10\p@}}%
%%%%%%%\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
```
chapters in your class would be like those in report class, but not add space to lot and lof files.
| 1 | https://tex.stackexchange.com/users/1090 | 684867 | 317,732 |
https://tex.stackexchange.com/questions/684869 | 1 | I am using this [solution](https://tex.stackexchange.com/a/324095/46385) by Bernard to have equations in display mode appear single-spaced in a double-spaced document.
How can I achieve a similar result for inline math?
```
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{physics}
\usepackage{fontspec}
\usepackage[doublespacing,nodisplayskipstretch]{setspace}
\usepackage{etoolbox}
\BeforeBeginEnvironment{align*}{\begin{singlespace}\vspace*{-\baselineskip}}
\AfterEndEnvironment{align*}{\end{singlespace}\noindent\ignorespaces}
\begin{document}
\lipsum*[2]
\begin{align*}
Abc = DEF \\
DEF = Abc
\end{align*}
\lipsum[2]
Inline math: $\mqty(x\\y)$
\end{document}
```
| https://tex.stackexchange.com/users/46385 | Inline math with double spacing | false | It's better to set `\jot` to a negative dimension. Next, you can set `\arraystretch` to the reciprocal of `\baselinestretch`, which will affect `array` based objects.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{physics}
\usepackage[
doublespacing,
nodisplayskipstretch
]{setspace}
\usepackage{lipsum}
\setlength{\jot}{-4pt}
\renewcommand{\arraystretch}{0.6}
\begin{document}
\lipsum*[2]
\begin{align*}
Abc = DEF \\
DEF = Abc
\end{align*}
\lipsum[2]
Inline math: $\mqty(x\\y)$
\end{document}
```
Explanation: `amsmath` adds `\jot` to the interline spacing in its alignment environments.
Not that I endorse using `physics`; actually I recommend *not* using it.
If you want to also fix `cases`, load `etoolbox` and, in the document preamble, say
```
\makeatletter
\patchcmd{\env@cases}{1.2}{0.72}{}{}
\makeatother
```
Why `0.72`? Because `\env@cases` does `\renewcommand{\arraystretch}{1.2}`, but we actually want it to be `1.2` times `0.6`, which is the reciprocal of `1.667`, the value of `\baselinestretch` for `doublespacing`.
If `\onehalfspacing` is used, it corresponds to a value `1.25` of `\baselinestretch` and the reciprocal to use is `0.8`. For `cases` you need `0.96` instead of `0.72`.
| 1 | https://tex.stackexchange.com/users/4427 | 684872 | 317,734 |
https://tex.stackexchange.com/questions/684870 | 2 | I create one global clist and assign `4, 300` as the two elements to it. `\clist_count:N` shows its 2 elements. If I copy this clist to a local list the contents of the new list are identical but `\clist_count:N` shows only 1 element. Why is that?
```
\documentclass{scrlttr2}
\ExplSyntaxOn
\clist_clear_new:N \g__timelist_median_clist
\clist_new:N \l__timelist_median_clist
\NewDocumentCommand{\setlist}{m}
{
\clist_gset:Nn \g__timelist_median_clist { #1 }
}
\NewDocumentCommand{\showlist}{}
{
% set a comma separated list
\clist_set:Nn \l__timelist_median_clist { \g__timelist_median_clist }
g__timelist_median_clist:\ \clist_use:Nn \g__timelist_median_clist {,}\\
count:\ \clist_count:N \g__timelist_median_clist\\
l__timelist_median_clist:\ \clist_use:Nn \l__timelist_median_clist {,}\\
count:\ \clist_count:N \l__timelist_median_clist\\
}
\ExplSyntaxOff
\begin{document}
\setlist{4,300}
\showlist
\end{document}
```
| https://tex.stackexchange.com/users/281557 | Why do two identical clists have different element counts? | true | add debugging messages:
```
\documentclass{scrlttr2}
\ExplSyntaxOn
\clist_clear_new:N \g__timelist_median_clist
\clist_new:N \l__timelist_median_clist
\NewDocumentCommand{\setlist}{m}
{
\clist_gset:Nn \g__timelist_median_clist { #1 }
}
\NewDocumentCommand{\showlist}{}
{
% set a comma separated list
\clist_set:Nn \l__timelist_median_clist { \g__timelist_median_clist }
g__timelist_median_clist:\ \clist_use:Nn \g__timelist_median_clist {,}\\
count:\ \clist_count:N \g__timelist_median_clist\\
l__timelist_median_clist:\ \clist_use:Nn \l__timelist_median_clist {,}\\
count:\ \clist_count:N \l__timelist_median_clist\\
\clist_show:N\l__timelist_median_clist
\clist_show:N\g__timelist_median_clist
}
\ExplSyntaxOff
\begin{document}
\setlist{4,300}
\showlist
\end{document}
```
you then see
```
The comma list \l__timelist_median_clist contains the items (without outer
braces):
> {\g__timelist_median_clist }.
```
and
```
The comma list \g__timelist_median_clist contains the items (without outer
braces):
> {4}
> {300}.
```
as `\clist_set:Nn \l__timelist_median_clist { \g__timelist_median_clist }` does not copy the 2 element list, it makes a new 1-item list consisting of
the csname token for the global list.
you want `\clist_set_eq:NN`
| 4 | https://tex.stackexchange.com/users/1090 | 684873 | 317,735 |
https://tex.stackexchange.com/questions/684879 | 2 | How can I programmatically find the height and width of a node?
```
\usepackage{twemojis}
\begin{tikzpicture}
\tikzset{nodestyle/.style={rectangle, rounded corners, draw=black, thick, fill=black!50}}
\node[nodestyle] (node00) at (0, 0) {{\LARGE\texttwemoji{dollar banknote}}};
\node[nodestyle, right=0pt of node00] (node01) {};
\end{tikzpicture}
```
I would like to set the height and width `node01` identical to `node00`.
| https://tex.stackexchange.com/users/277830 | How to programmatically find the height and width of a node? | true | You can use `\pgfgetlastxy` or `\pgfextractx` and `\pgfextracty`. One uses macros and the other uses length registers.
```
\documentclass{standalone}
\usepackage{tikz}
\usepackage{twemojis}
\newlength{\mywidth}
\newlength{\myheight}
\newcommand{\getwh}[1]{% #1 = node name (no parens)
\pgfextractx{\mywidth}{\pgfpointdiff{\pgfpointanchor{#1}{west}}{\pgfpointanchor{#1}{east}}}%
\pgfextracty{\myheight}{\pgfpointdiff{\pgfpointanchor{#1}{south}}{\pgfpointanchor{#1}{north}}}%
}
\begin{document}
\begin{tikzpicture}
\tikzset{nodestyle/.style={rectangle, rounded corners, draw=black, thick, fill=black!50}}
\node[nodestyle] (node00) at (0, 0) {{\LARGE\texttwemoji{dollar banknote}}};
\getwh{node00}% get size based on anchors
\addtolength{\mywidth}{-0.8pt}% remove line thickness
\addtolength{\myheight}{-0.8pt}% remove line thickness
\node[nodestyle, right=0pt, minimum width=\mywidth, minimum height=\myheight] at (node00.east) (node01) {};
\end{tikzpicture}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/34505 | 684881 | 317,737 |
https://tex.stackexchange.com/questions/684882 | 2 | My publisher wants my images to be able to be loaded at 100% scale so that font sizes aren't scaled, but requires widths to be one of 20mm, 44mm, 68mm, 82mm or 140mm to correspond to the column widths (20mm+4mm gap).
I have several standalone images with text that would need to fit one of these measurements.
What's the best way to do this? It seems to be complicated by the need to use different compilers. (I am using XeLaTeX)
Here is an example file which has a generated width of 63 mm that I would like to be 44mm.
```
\documentclass{standalone}
\usepackage{xcolor}%RGB Definitions
\definecolor{PG-Chem}{RGB}{5,114,118}
\usepackage {tikz}
\usepackage{mathspec}
\setmainfont{Source Sans Pro}
\begin{document}
\begin {tikzpicture}[yscale=0.05]
%Define Isotopes
\pgfmathsetmacro {\isotopeAmass}{10}
\pgfmathsetmacro {\isotopeBmass}{11}
\pgfmathsetmacro {\isotopeAabundance}{19.97}
\pgfmathsetmacro {\isotopeBabundance}{80.03}
\pgfmathsetmacro {\xmin}{\isotopeAmass-2}
\pgfmathsetmacro {\xmax}{\isotopeBmass+2}
%draw Grid & axes
\draw [thick, ->] (\xmin,0)--(\xmin,100) node [midway, anchor=south, rotate=90, yshift=0.5cm]{\% Abundance}; %y-axis
\draw [thick, ->] (\xmin,0)--(\xmax,0) node [midway, anchor=north,yshift=-0.5cm]{mass/charge ratio}; %x-axis
\foreach \x in {\xmin,...,\xmax}
\draw (\x,-0.75) -- (\x ,0) node[below,anchor=north,yshift=-3pt]{\x}; %x-axis tick marks
\foreach \y in {10,20,...,100}
\draw (\xmin-0.1, \y cm) -- (\xmin, \y cm) node[above,anchor=east]{\y}; %y-axis tick marks
\foreach \g in {10,20,...,100}
\draw[gray!50,very thin] (\xmin, \g ) -- (\xmax, \g ); %horizontal grid
%Draw spectrum
\draw[line width=2pt,PG-Chem] (\isotopeAmass,0)--(\isotopeAmass,\isotopeAabundance) node [above, anchor=south]{\isotopeAabundance \%};
\draw[line width=2pt,PG-Chem] (\isotopeBmass,0)--(\isotopeBmass,\isotopeBabundance)node [above, anchor=south]{\isotopeBabundance \%};
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/107583 | Standalone document of a fixed width | false | By `standalone` as any other document class you cannot prescribe images widths. Their widths are always define by image itself.
In your case seems that the closest what you like to achieve is use `pgfplots` package for drawing of diagram. Using it you can quite simple prescribe images widths by `axis` option ˙width=`. Beside this, using` pgfplots` the diagram code is simpler and more consistent:
```
% XeTeX
\documentclass{standalone}
\usepackage{mathspec}
\setmainfont{Source Sans Pro}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\definecolor{PG-Chem}{RGB}{5,114,118}
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=82mm, % <--- width of image
axis lines=left,
axis line style = {thick},
ybar,
bar width=2pt, % you may define wider width: 4pt or even more
ymajorgrids,
xlabel = {\% Abundance},
ylabel = {mass/charge ratio},
xmin=8, xmax=13,
ymin=0, ymax=100,
ytick distance = 10,
nodes near coords={\pgfmathprintnumber\pgfplotspointmeta\,\%},
]
%Draw spectrum
\addplot [draw=PG-Chem, fill=PG-Chem] coordinates { (10, 19.97) (11, 80.03) };
\end{axis}
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/18189 | 684891 | 317,741 |
https://tex.stackexchange.com/questions/684894 | 0 | Given several .bib files `ref1.bib,ref2.bib,ref3.bib,...` and a latex document which uses a subset of the references from all the .bib files via `\bibliography{ref1,ref2,ref3,...}`, I would like to generate a new .bib file `combined_ref.bib` which contains the original bibtex entries of all references that are cited in the latex document.
I am aware of the .bbl file, but it outputs a formatted list of references. I want basically a similar file but with the original bibtex entries.
Is there a way to do that?
| https://tex.stackexchange.com/users/46385 | Combine bib files | false | You could use Zotero (or any other similar program) to import all your .bib files, and then export the full library.
I personally haven't tried this, but sounds possible.
| 0 | https://tex.stackexchange.com/users/292732 | 684896 | 317,742 |
https://tex.stackexchange.com/questions/684532 | -1 | The height from the top of the page is currently 3.5cm to top of chapter. I want to reduce to 1.5cm.
Height from bottom of chapter is currently 1.5cm and I want to reduce to 0.5cm if possible.
I have tried to resolve Questions [407843](https://tex.stackexchange.com/questions/407843) and 28195992 and [148747](https://tex.stackexchange.com/questions/148747) without success.
I've put the code in the preamble and I'm not sure if that was correct?
---
I have an example but `etoolbox` example is not correct and I do not know why.
My book has 14 chapters and I have used in this example some of the info in the preamble of it.
Btw, the bibliography that was an issue was solved, thanks to those who worked on it.
```
\documentclass[pdftex,11pt,a4paper]{book} % report maybe book??
\usepackage{titlesec}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{afterpage}
\usepackage{color}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{typearea}
\usepackage{titlesec}
\usepackage{graphicx}
\usepackage[all]{xy}
\usepackage{pdfpages}
\usepackage{multicol}
\usepackage{url}
\usepackage{textcomp}
\usepackage{lmodern}% http://ctan.org/pkg/lm
\usepackage{hyperref} % Needs to be last package included
\usepackage[alphabetic,initials,nobysame]{amsrefs} %must be loaded after hyperref to work properly
%\texorpdfstring{tex}{string}
\hypersetup{
unicode=false, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={Thermal Fluid Heating, A Practical Guide for the Thermal Fluid Practitioner}, % title
pdfauthor={Geoff Senior}, % author
pdfsubject={Thermal Fluid Heating}, % subject of the document
pdfcreator={Geoff Senior}, % creator of the document
pdfproducer={Geoff Senior}, % producer of the document
pdfkeywords={Thermal Fluid Heating, Hot Oil Heating, High Temperature Oil Heating}, % list of keywords
pdfnewwindow=true, % links in new window
colorlinks=true, % false: boxed links; true: colored links
linkcolor=black, %red, % color of internal links % black for print, red for electronic
citecolor=black, %green, % color of links to bibliography % black for print, green for electronic
filecolor=black, %magenta, % color of file links % black for print, magenta for electronic
urlcolor=black %cyan % color of external links % black for print, cyan for electronic
}
% Set margins
\usepackage[inner=20mm, outer=10mm, textwidth=150mm, paperwidth=210mm, paperheight=297mm]{geometry}
\setlength{\voffset}{-1.45in}
\setlength{\textwidth}{18cm}
\setlength{\textheight}{27cm}
\setlength{\topmargin}{1.5cm}
\setlength{\headsep}{15pt} % Optional - separation between header and top of text - default is 25pt
\setlength{\footskip}{-0.25in} % Optional - separation between footer and bottom of text - default is 30pt
% Fancyhdr commands
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\fancyhf{}
\makeatletter
\renewcommand{\chaptermark}[1]{\markboth{\@chapapp\ \thechapter:\ #1}{}}
\makeatother
\renewcommand{\sectionmark}[1]{\markright{\thesection:\ #1}{}}
\fancyhead[LE]{\slshape \leftmark}
\fancyhead[RO]{\slshape \rightmark}
\fancyfoot[C]{\thepage}
\setlength{\parindent}{0pt}
% setting level of subsections
\setcounter{secnumdepth}{4}
\pdfminorversion=7
\usepackage{etoolbox}
%etoolbox
\makeatletter
\patchcmd{\@makeschapterhead}{50\p@}{\chapheadtopskip}{}{}
\patchcmd{\@makeschapterhead}{40\p@}{\chapheadbelowskip}{}{}
\makeatother
% Set new lengths
\newlength{\chapheadtopskip}\setlength{\chapheadtopskip}{20pt}
\newlength{\chapheadsep}\setlength{\chapheadsep}{40pt}
\newlength{\chapheadbelowskip}\setlength{\chapheadbelowskip}{15pt}
\newcommand{\blanknonumber}{\newpage \thispagestyle{empty}}
\makeatletter
\renewcommand{\chaptermark}[1]{\markboth{\@chapapp\ \thechapter:\ #1}{}}
\makeatother
\renewcommand{\sectionmark}[1]{\markright{\thesection:\ #1}{}}
\titleformat{\chapter}[display]
{\bfseries\Huge}
{\LARGE\filright\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{2ex}
{\titlerule
\vspace{1ex}%
\filright}
[\vspace{1ex}%
\titlerule]
%\frontmatter %Set pages to roman (i, ii, ...)
\makeatletter
\@openrighttrue
\makeatother
\begin{document}
\texorpdfstring{tex}{string}
\addcontentsline{toc}{chapter}{Table of Contents}
\tableofcontents
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\newgeometry{textwidth=150mm}
\restoregeometry
\chapter{Introduction}
\label{chapter_introduction}
\fancyhead[LE]{\slshape \leftmark}
\fancyhead[RO]{\slshape \rightmark}
\fancyfoot[C]{\thepage}
\flushbottom
The motive behind writing this book is to provide, as a guide, some practical information about thermal fluid heating systems as used in industrial heating applications. \\
\chapter{Thermal Fluid Systems}
\label{chapter_Thermal Fluid Systems}
\noindent
\section{Historical}
\label{history}
There is not much that can be found regarding the history of hot oil heating, however it is believed that its inception was as a result of Oil Companies or Road Paving Organisations (circa 1940's) wanting to heat bitumen without the use of steam, particularly so in a road making environment, away from the refinery locations where high pressure equipment was paramount.
\end{document}
```
| https://tex.stackexchange.com/users/116040 | How to reduce the space from top of page to chapter heading and from under chapter heading to top of text? | false | To long for a comment …
Your mistake here is, to try to use both: Patching `\@makeschapterhead` *and* the `titlesec` interface to change the chapter headings. Using `titlesec` result in a changed definition of `\@makeschapterhead`, so the patch is no longer successful. You can test this, by adding an patch failure handling to your `\patchcmd` commands, e.g.
```
\makeatletter
\patchcmd{\@makeschapterhead}{50\p@}{\chapheadtopskip}{}{\errmessage{Cannot
patch \string\@makeschapterhead\space above skip value}}
\patchcmd{\@makeschapterhead}{40\p@}{\chapheadbelowskip}{}{\errmessage{Cannot
patch \string\@makeschapterhead\space below skip value}}
\makeatother
```
would result in
```
Cannot patch \@makeschapterhead above skip value.
<argument> ...chapterhead \space above skip value}
l.83 ...\@makeschapterhead\space above skip value}}
Cannot patch \@makeschapterhead below skip value.
<argument> ...chapterhead \space below skip value}
l.85 ...\@makeschapterhead\space below skip value}}
```
So have to either remove the `titlesec` package and the `titlesec` code and use the patch from [Mico's answer to the already linked question](https://tex.stackexchange.com/a/407847/277964). In this case please also note, that `\@makeschapterhead` is the command used by `\chapter*` (with star) only. For `\chapter` (without star) you also need to patch `\@makechapterhead` as shown in the already linked answer. Alternatively you can remove the patch and use the `titlesec` interface as shown in [chadoulis' answer to the already linked question](https://tex.stackexchange.com/a/407848/277964).
Note that there are several other things about your code that I consider questionable. I have written some comments about this. For this reason I will not post the complete code again. A minimized complete example using `titlesec` would be:
```
\documentclass[12pt,a4paper]{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\Huge\bfseries}{\chaptertitlename\
\thechapter}{0.25cm}{\Huge}% see titlesec manual
\titlespacing{\chapter}{0pt}{1.5cm}{0.5cm}% see titlesec manual
\usepackage{lipsum}% for demonstration only.
\begin{document}
\chapter{Title of Chapter}
\lipsum
\end{document}
```
You can reduce the `1.5cm` even to a negative value, if your 1.5cm are from the top of the page instead of from the start of the text area.
A minimized complete example not using `titlesec` but patching the class would be:
```
\documentclass[12pt,a4paper]{book}
\usepackage{etoolbox} % for "\patchcmd" macro
\makeatletter
% Reduce extra space between start of text area and and chapter header lines:
\patchcmd{\@makechapterhead} {50\p@}{1.5cm }{}{\errmessage{Cannot patch \string\@makechapterhead\space above skip value}}% for \chapter
\patchcmd{\@makeschapterhead}{50\p@}{1.5cm }{}{\errmessage{Cannot patch \string\@makeschapterhead\space above skip value}} % for \chapter*
% Reduce extra space between chapter header and section header lines by 50%:
\patchcmd{\@makechapterhead} {40\p@}{0.5cm }{}{\errmessage{Cannot patch \string\@makechapterhead\space below skip value}}% for \chapter
\patchcmd{\@makeschapterhead}{40\p@}{0.5cm }{}{\errmessage{Cannot patch \string\@makeschapterhead\space below skip value}} % for \chapter*
% Optionally reduce the extra space between number line and title text
\patchcmd{\@makechapterhead} {20\p@}{0.25cm }{}{\errmessage{Cannot patch \string\@makechapterhead\space number title skip value}}% for \chapter only
\makeatother
\usepackage{lipsum}% for demonstration only.
\begin{document}
\chapter{Background}
\lipsum
\end{document}
```
Once again, the `cm` values could even be negative, if you would like.
| 0 | https://tex.stackexchange.com/users/277964 | 684914 | 317,751 |
https://tex.stackexchange.com/questions/684920 | 4 | I observe the style of a theorem that uses a shared counter being changed unexpectedly when `cleveref` is used.
I expect all new theorems to have the default style `plain` as in `asmbook`, with small caption title font and italic body font.
However, when `cleveref` is used, the `fact` theorem, which shares a counter with the `lemma` theorem, changes its style unexpectedly.
I attempt to fix it by explicitly stating `\theoremstyle{plain}` before creating `fact`. However, it does not work.
Then, I create a new theorem style `factstyle` and hardcode the `plain` style in it. This can fix the issue.
I notice that if the document class is just `document`, there is no such issue. I also acknowledge that `hyperref` needs to be declared before `cleveref` and all `\newtheorem` definitions must be placed after the `cleveref` package is loaded.
What is going on here? Does `cleveref` have conflict with `asmbook` style?
Here are the code to reproduce the issue and the fixes:
```
\documentclass[a4paper,oneside,11pt,reqno]{amsbook}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{amsthm}
\DeclareOption*
\ProcessOptions
\theoremstyle{plain}
\newtheorem{lemma}{Lemma}
% Plain style
\newtheorem{remark}{remark}
%%%%%%
% Style Fix
% \newtheoremstyle{factstyle}% name of the style to be used
% {}% measure of space to leave above the theorem. E.g.: 3pt
% {}% measure of space to leave below the theorem. E.g.: 3pt
% {\itshape}% name of font to use in the body of the theorem
% {1.5em}% measure of space to indent
% {\scshape}% name of head font
% {.}% punctuation between head and body
% { }% space after theorem head; " " = normal interword space
% {\thmname{#1}\thmnumber{ #2}\textnormal{\thmnote{ (#3)}}}
% \theoremstyle{factstyle}
%%%%%%
% Should be Plain style but changed by cleveref?
\theoremstyle{plain}
\newtheorem{fact}[lemma]{Fact}
\begin{document}
\section{Cleveref changes theorem style unexpectedly}
\begin{lemma}
This is a lemma.
\end{lemma}
\begin{remark}
This is a remark.
\end{remark}
\begin{fact}
This is a fact.
This should look like remark however it looks differently.
When Fact shares the counter with Lemma, its style changes if cleveref is used.
To fix: Uncomment "Style Fix", or stop using cleveref.
\end{fact}
\end{document}
```
| https://tex.stackexchange.com/users/296448 | Why does cleveref change theorem style unexpectedly? | true | In general, `amsthm` should be loaded before `cleveref`. However, `amsbook` disables loading `amsthm`, because it has it built-in.
The way `amsbook` disables loading `amsthm` has the consequence that `amsthm` passes the `\@ifpackageloaded` test, which `cleveref` relies on. Chaos ensues.
Likely, `cleveref` should also have a test for the class being `amsart` or `amsbook`, so this conflict (possibly) doesn't happen. Below is a workaround.
```
\documentclass[a4paper,oneside,11pt,reqno]{amsbook}
%%% undo amsbook settings similar to amsthm
\expandafter\let\csname ver@amsthm.sty\endcsname\relax
\let\theoremstyle\relax
\let\newtheoremstyle\relax
\let\pushQED\relax
\let\popQED\relax
\let\qedhere\relax
\let\mathqed\relax
\let\openbox\relax
\let\proof\relax
\let\endproof\relax
%%% now loading amsthm is possible
\usepackage{amsthm}
\usepackage{hyperref}
\usepackage{cleveref}
%%% emulate the plain theorem style of amsbook
\newtheoremstyle{amsbookplain}% name of the style to be used
{}% measure of space to leave above the theorem. E.g.: 3pt
{}% measure of space to leave below the theorem. E.g.: 3pt
{\itshape}% name of font to use in the body of the theorem
{\parindent}% measure of space to indent
{\scshape}% name of head font
{.}% punctuation between head and body
{ }% space after theorem head; " " = normal interword space
{\thmname{#1}\thmnumber{ #2}\textnormal{\thmnote{ (#3)}}}
\theoremstyle{amsbookplain}
\newtheorem{lemma}{Lemma}
\newtheorem{fact}[lemma]{Fact}
\newtheorem{remark}{remark}
%%%%%%
\begin{document}
\section{Cleveref changes theorem style unexpectedly}
\begin{lemma}
This is a lemma.
\end{lemma}
\begin{remark}
This is a remark.
\end{remark}
\begin{fact}
This is a fact.
This should look like remark however it looks differently.
When Fact shares the counter with Lemma, its style changes if cleveref is used.
To fix: Uncomment "Style Fix", or stop using cleveref.
\end{fact}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/4427 | 684925 | 317,753 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.