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/695032
0
I often have the problem when speaking about a LaTeX document that I say e.g. "please see 3.5" and that only then I realize that this could refer to a) a section, b) a equation and c) a figure and therefor then add e.g. "eh… I mean *section* 3.5". Is there some way to only have *one* namespace for chapters/sections, equations and figures? There seems to be nothing on the internet about that yet (probably because it'd look awful), so any help is appreciated.
https://tex.stackexchange.com/users/185129
Single namespace for chapters, equations and figures?
true
I can't believe this is usable, but ``` \documentclass{book} \makeatletter \let\c@section\c@chapter \let\thesection\thechapter \counterwithout*{section}{chapter} \let\c@subsection\c@chapter \let\thesubsection\thechapter \counterwithout*{subsection}{section} \let\c@figure\c@chapter \let\thefigure\thechapter \counterwithout*{figure}{chapter} \makeatother \begin{document} \chapter{aaa} \section{bbbb} aaa \begin{figure}[h] xxxxx \caption{qqqq} \end{figure} \chapter{aaa} \section{bbbb} aaa \subsection{bbbb} aaa \begin{figure}[h] xxxxx \caption{qqqq} \end{figure} \end{document} ```
1
https://tex.stackexchange.com/users/1090
695034
322,483
https://tex.stackexchange.com/questions/694946
-1
In this resume template: How can I move the output of the command `\cvdetail` to the left most side? Nothing seems to work for me. Link: <https://www.overleaf.com/latex/templates/resume/rysrqppxyvdg>
https://tex.stackexchange.com/users/299988
CV template in overleaf
false
Just guessing, what "move to left" might or might not mean, I suspect you want to rewrite the `\newcommand`: * now it's a table * where the first entry is empty * AND its width is set to 2.5cm via `p{2.5cm}` ``` \newcommand{\cvdetail}[1]{ \begin{tabular*}{1\textwidth}{p{2.5cm} p{14.5cm}} & \larrow{bgcol} #1\\ [3pt] \end{tabular*} } ``` So adjust the width to less than 2.5 cm, OR remove the table at all: ``` \newcommand{\cvdetail}[1]{ % \begin{tabular*}{1\textwidth}{p{2.5cm} p{14.5cm}} % & \larrow{bgcol} #1\\ [3pt] % \end{tabular*} } ```
0
https://tex.stackexchange.com/users/245790
695038
322,485
https://tex.stackexchange.com/questions/695035
1
I have a problem with display math modes `$$...$$` and `\[...\]`, see [The display math mode and the `center` environment](https://tex.stackexchange.com/questions/695023/the-display-math-mode-and-the-center-environment). So, I want to find the definition of the display math mode `$$...$$` for understading it clearly. However, I can't find where is the definition of the display math mode. Please, let me know, where is the definition of the display math mode `$$...$$`?
https://tex.stackexchange.com/users/303202
Where is the definition of the math mod environment `$$...$$`?
false
`$$` is defined in the source code of tex, it is not a latex-defined environment. Any two characters of catcode 3 start display math. The source is written in web (pascal) tex.web is available from ctan <https://ctan.org/tex-archive/systems/knuth/dist/tex> Here is the part that scans for `$` or `$$` to enter inline or display math. ``` @ We get into math mode from horizontal mode when a `\.\$' (i.e., a |math_shift| character) is scanned. We must check to see whether this `\.\$' is immediately followed by another, in case display math mode is called for. @<Cases of |main_control| that build...@>= hmode+math_shift:init_math; @ @<Declare act...@>= procedure init_math; label reswitch,found,not_found,done; var w:scaled; {new or partial |pre_display_size|} @!l:scaled; {new |display_width|} @!s:scaled; {new |display_indent|} @!p:pointer; {current node when calculating |pre_display_size|} @!q:pointer; {glue specification when calculating |pre_display_size|} @!f:internal_font_number; {font in current |char_node|} @!n:integer; {scope of paragraph shape specification} @!v:scaled; {|w| plus possible glue amount} @!d:scaled; {increment to |v|} begin get_token; {|get_x_token| would fail on \.{\\ifmmode}\thinspace!} if (cur_cmd=math_shift)and(mode>0) then @<Go into display math mode@> else begin back_input; @<Go into ordinary math mode@>; end; end; @ @<Go into ordinary math mode@>= begin push_math(math_shift_group); eq_word_define(int_base+cur_fam_code,-1); if every_math<>null then begin_token_list(every_math,every_math_text); end @ We get into ordinary math mode from display math mode when `\.{\\eqno}' or `\.{\\leqno}' appears. In such cases |cur_chr| will be 0 or~1, respectively; the value of |cur_chr| is placed onto |save_stack| for safe keeping. @<Cases of |main_control| that build...@>= mmode+eq_no: if privileged then if cur_group=math_shift_group then start_eq_no else off_save; @ @<Put each...@>= primitive("eqno",eq_no,0); @!@:eq_no_}{\.{\\eqno} primitive@> primitive("leqno",eq_no,1); @!@:leq_no_}{\.{\\leqno} primitive@> @ When \TeX\ is in display math mode, |cur_group=math_shift_group|, so it is not necessary for the |start_eq_no| procedure to test for this condition. @<Declare act...@>= procedure start_eq_no; begin saved(0):=cur_chr; incr(save_ptr); @<Go into ordinary math mode@>; end; @ @<Cases of |print_cmd_chr|...@>= eq_no:if chr_code=1 then print_esc("leqno")@+else print_esc("eqno"); @ @<Forbidden...@>=non_math(eq_no), @ When we enter display math mode, we need to call |line_break| to process the partial paragraph that has just been interrupted by the display. Then we can set the proper values of |display_width| and |display_indent| and |pre_display_size|. @<Go into display math mode@>= begin if head=tail then {`\.{\\noindent\$\$}' or `\.{\$\${ }\$\$}'} begin pop_nest; w:=-max_dimen; end else begin line_break(display_widow_penalty);@/ @<Calculate the natural width, |w|, by which the characters of the final line extend to the right of the reference point, plus two ems; or set |w:=max_dimen| if the non-blank information on that line is affected by stretching or shrinking@>; end; {now we are in vertical mode, working on the list that will contain the display} @<Calculate the length, |l|, and the shift amount, |s|, of the display lines@>; push_math(math_shift_group); mode:=mmode; eq_word_define(int_base+cur_fam_code,-1);@/ eq_word_define(dimen_base+pre_display_size_code,w); eq_word_define(dimen_base+display_width_code,l); eq_word_define(dimen_base+display_indent_code,s); if every_display<>null then begin_token_list(every_display,every_display_text); if nest_ptr=1 then build_page; end ```
5
https://tex.stackexchange.com/users/1090
695039
322,486
https://tex.stackexchange.com/questions/695043
1
I am writing my notes in latex, and have to open a reference pdf stored in devonthink, which has an option of creating a link like x-devonthink-item://2A4BA600-D5CB-4414-852F-5FC596703941 Usually it opens when I add it in obsidian with file tag. But not aware how to get it accessed in pdf generated by latex. > > What I want is to create a link in latex generated pdf, which when > clicked should open the pdf in devonthink on my Mac. > > >
https://tex.stackexchange.com/users/19233
open pdf file stored in devonthink via link in pdf generated by latex
true
Simply adding the link using `\href` works. Remember to load `hyperref` last in your list of packages unless another package specifically tells you to load it before that package. Whether the link works depends on your PDF viewer. The following document works for me with Skim and Adobe Reader, but not Preview. ``` \documentclass{article} \usepackage{hyperref} \begin{document} \href{x-devonthink-item://9DBEDEA0-3F7A-4DA5-8EB7-1FB5E0658494}{My Devonthink document} \end{document} ```
2
https://tex.stackexchange.com/users/2693
695044
322,489
https://tex.stackexchange.com/questions/695047
1
I am having an issue even while using the table, the table is exceeding the right margin. Below is the code: ``` \documentclass[12 pt, a4paper]{book} \usepackage{multicol} \usepackage{geometry} \geometry{ a4paper, total={170 mm,257 mm}, left=20 mm, top=20 mm, } \usepackage{amsmath,bm} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{soul} \usepackage{indentfirst} \usepackage[utf8]{inputenc} \usepackage{palatino} \usepackage[dvipsnames]{xcolor} \usepackage{xcolor} \usepackage{graphicx} \usepackage{fancyhdr} \usepackage{array} \usepackage{enumitem} \usepackage{mathtools} \usepackage{cancel} \usepackage{arydshln} \usepackage{calc} \usepackage{float} \usepackage{ulem} \usepackage{multirow} \begin{table}[h] \setlength\extrarowheight{2pt} \begin{tabular}{| c | c | c | c |} \hline \multirow{2}{*}{\begin{tabular}{c}\textbf{Operations}\end{tabular}} & \multicolumn{3}{c |}{\textbf{Subtraction Magnitudes}} \\ \cline{2-4} & A $>$ B & A $<$ B & A $=$ B \\ \hline (+A) + (-B) & +(A - B) & -(B - A) & +(A - B) \\ \hline (-A) + (+B) & -(A - B) & +(B - A) & +(A - B) \\ \hline (+A) - (+B) & +(A - B) & -(B - A) & +(A - B) \\ \hline (-A) - (-B) & -(A - B) & +(B - A) & +(A - B) \\ \hline \end{tabular} \caption{Subtraction using Signed Magnitude Representation} \end{table} ``` Can someone please help me to align this table in the center of the page?
https://tex.stackexchange.com/users/218653
Table is exceeding the right margin
false
The `tabular` environment in your code fits fine. What's missing is a `\centering` directive, so that the table and its caption are both centered. Some further suggestions, in no particular order: * Since almost all contents of the table are "math-y", I'd use an `array` environment instead of a `tabular` environment. * The `palatino` package is obsolete, just as the `times` package is. I suggest you load the `newpxtext` package instead of the `palatino` package. I'd further load the `newpxmath` package, to provide a Palatino-clone math font package. (Palatino text and Computer Modern math do not harmonize well.) * I can see no reason for **bold-facing** the contents of the table's header row. * The preamble code contains several minor inefficencies. I've commented on some of them in the code below. Do check if you could remove some of the cruft that's present in your document's preamble. ``` \documentclass[12pt, a4paper]{book} \usepackage{multicol} % are you sure this is needed? \usepackage{geometry} \geometry{%a4paper, % this is already set globally total={170mm, 257mm}, left=20mm, top=20mm} \usepackage{%amsmath, % is loaded automatically by 'mathtools' bm} %%\usepackage{amsfonts} % is loaded automatically by 'amssymb' \usepackage{amssymb} \usepackage{soul} \usepackage{indentfirst} \usepackage[T1]{fontenc} % <-- new %%\usepackage[utf8]{inputenc} % that's the default nowadays %%\usepackage{palatino} % 'palatino' package is deprecated \usepackage{newpxtext} % <-- more modern than 'palatino' package \usepackage{newpxmath} % <-- Palatino-clone math font \usepackage[dvipsnames]{xcolor} %%\usepackage{xcolor} % don't load packages twice \usepackage{graphicx} \usepackage{fancyhdr} % are you sure this is needed? \usepackage{array} % for '\extrarowheight' macro \usepackage{enumitem} \usepackage{mathtools} \usepackage{cancel} \usepackage{arydshln} % are you sure this is needed? \usepackage{calc} \usepackage{float} % are you sure this is needed? \usepackage[normalem]{ulem} % I've added 'normalem' option \usepackage{multirow} \begin{document} \begin{table}[htbp] \setlength\extrarowheight{2pt} % nice touch! \centering % <-- new $\begin{array}{| c | c | c | c |} % suggest using 'array' instead of 'tabular' \hline \multirow{2.1}{*}{\textnormal{Operations}} & % first arg. of '\multirow' needn't be integer-valued \multicolumn{3}{c|}{\textnormal{Subtraction magnitudes}}\\ \cline{2-4} & A > B & A < B & A = B \\ \hline (+A) + (-B) & +(A - B) & -(B - A) & +(A - B) \\ \hline (-A) + (+B) & -(A - B) & +(B - A) & +(A - B) \\ \hline (+A) - (+B) & +(A - B) & -(B - A) & +(A - B) \\ \hline (-A) - (-B) & -(A - B) & +(B - A) & +(A - B) \\ \hline \end{array}$ \caption{Subtraction using signed magnitude representation} \end{table} \end{document} ```
4
https://tex.stackexchange.com/users/5001
695052
322,493
https://tex.stackexchange.com/questions/262584
3
MWE: ==== ``` \documentclass[a4paper,12pt,twoside]{memoir} \usepackage{DejaVuSerifCondensed} \usepackage[T1]{fontenc} \begin{document} \noindent\scshape{Hello World}\\ \textsc{Hello World} \end{document} ``` Explanation and question: ========================= As you can see, I am working with a `memoir` document class and I've load a font `DejaVuSerifCondensed`, I am trying to obtain small caps for my header (which I did not place in the MWE as unnecessary). However I can't obtain the desire effect with the `\scshape` command nor with the `\textsc{}`. I've seen other questions like * [When using \textsc, LaTeX issues warning: Font shape `OT1/cmr/bx/sc' undefined](https://tex.stackexchange.com/questions/37618/a-problem-with-textsc) * [Small Caps and Bold Face](https://tex.stackexchange.com/questions/27411/small-caps-and-bold-face) * [Small Caps not Working](https://tex.stackexchange.com/questions/187398/small-caps-not-working). But either they do not adapt to my problem (for what I can see) or they do not solve the problem (following the instructions there and "inserting" the piece of code in mine). Question here is: is there a general method (piece of code or something) to obtain small caps from a custom font (even if that is one I upload with a ttf)?, if not, what would be the piece of code to select the *standard* small caps font?
https://tex.stackexchange.com/users/42784
Is there a general method for obtaining small caps with custom fonts?
false
This is the only post I could find with actual productive discussion of how to create fake small caps on stackexchange, so I thought I would chime in with an additional method I found [on the latex.org forum](https://latex.org/forum/viewtopic.php?t=18301). I'm retranscribing here in case the link dies in the future, and making minor alterations for readability. ``` \def\fakesc{\bgroup\obeyspaces\helpersc} \def\helpersc#1{\helperscii #1\relax\relax\egroup} \def\helperscii#1{% \ifx\relax#1\else \ifcat#1\@sptoken{} \expandafter\expandafter\expandafter\helperscii\else \ifnum`#1=\uccode`#1 {\normalsize #1}\else {\footnotesize \uppercase{#1}}\fi \expandafter\expandafter\expandafter\helperscii\expandafter\fi\fi} \fakesc{Any Text that needs Small Caps} ``` The code apparently originally comes from the French programming-support forum *Le site du Zéro* which eventually became OpenClassrooms, which now mainly offer actual courses. Though not indexed by search engines, some of the [old forum content](https://openclassrooms.com/forum/) is available -- but I couldn't find the specific post this code came from.
0
https://tex.stackexchange.com/users/167235
695056
322,496
https://tex.stackexchange.com/questions/695047
1
I am having an issue even while using the table, the table is exceeding the right margin. Below is the code: ``` \documentclass[12 pt, a4paper]{book} \usepackage{multicol} \usepackage{geometry} \geometry{ a4paper, total={170 mm,257 mm}, left=20 mm, top=20 mm, } \usepackage{amsmath,bm} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{soul} \usepackage{indentfirst} \usepackage[utf8]{inputenc} \usepackage{palatino} \usepackage[dvipsnames]{xcolor} \usepackage{xcolor} \usepackage{graphicx} \usepackage{fancyhdr} \usepackage{array} \usepackage{enumitem} \usepackage{mathtools} \usepackage{cancel} \usepackage{arydshln} \usepackage{calc} \usepackage{float} \usepackage{ulem} \usepackage{multirow} \begin{table}[h] \setlength\extrarowheight{2pt} \begin{tabular}{| c | c | c | c |} \hline \multirow{2}{*}{\begin{tabular}{c}\textbf{Operations}\end{tabular}} & \multicolumn{3}{c |}{\textbf{Subtraction Magnitudes}} \\ \cline{2-4} & A $>$ B & A $<$ B & A $=$ B \\ \hline (+A) + (-B) & +(A - B) & -(B - A) & +(A - B) \\ \hline (-A) + (+B) & -(A - B) & +(B - A) & +(A - B) \\ \hline (+A) - (+B) & +(A - B) & -(B - A) & +(A - B) \\ \hline (-A) - (-B) & -(A - B) & +(B - A) & +(A - B) \\ \hline \end{tabular} \caption{Subtraction using Signed Magnitude Representation} \end{table} ``` Can someone please help me to align this table in the center of the page?
https://tex.stackexchange.com/users/218653
Table is exceeding the right margin
false
A small variation of nice @Mico answer (+1). Main differences: * for table are used `tabularray` package (with it the table code is quite shorter) * positioning of floats are defined globally * at `geometry` package is used only `margin` options ``` \documentclass[12pt, a4paper]{book} \usepackage[margin=20mm]{geometry} \usepackage{indentfirst} \usepackage[T1]{fontenc} \usepackage{newpxtext} \usepackage{amssymb, bm, mathtools} % should be loaded before newpxmath \usepackage{newpxmath} \usepackage{graphicx} \usepackage[dvipsnames]{xcolor} \usepackage{tabularray} \UseTblrLibrary{amsmath} % global float positioning \makeatletter \def\fps@figure{hbtp} \def\fps@table{hbtp} \makeatother \begin{document} \begin{table} \centering \begin{tblr}{hlines, vlines, colspec = { *{4}{Q[c, mode=math]} }, row{1} = {mode=text}, rowsep=4pt } \SetCell[r=2]{} Operations & \SetCell[c=3]{} Subtraction magnitudes & & \\ & A > B & A < B & A = B \\ (+A) + (-B) & +(A - B) & -(B - A) & +(A - B) \\ (-A) + (+B) & -(A - B) & +(B - A) & +(A - B) \\ (+A) - (+B) & +(A - B) & -(B - A) & +(A - B) \\ (-A) - (-B) & -(A - B) & +(B - A) & +(A - B) \\ \end{tblr} \caption{Subtraction using signed magnitude representation} \end{table} \end{document} ```
0
https://tex.stackexchange.com/users/18189
695058
322,497