Skip to content

Commit 55cc6bb

Browse files
committed
Agregar bloque de alerta personalizado en plantilla de Notebook
1 parent af60124 commit 55cc6bb

File tree

1 file changed

+22
-135
lines changed

1 file changed

+22
-135
lines changed

notebooks/xx_plantilla.ipynb

+22-135
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,27 @@
108108
"</div>"
109109
]
110110
},
111+
{
112+
"cell_type": "markdown",
113+
"metadata": {},
114+
"source": [
115+
"Si queremos un recuadro con colores personalizados podemos usar el siguiente\n",
116+
"bloque de código\n",
117+
"\n",
118+
"```html\n",
119+
"<div class=\"alert alert-info\"\n",
120+
" style=\"color:#3c3c3c;background-color:#fd9df5;border-color:#9d6097\">\n",
121+
" <strong>¡Aviso!</strong> Este es un bloque con colores personalizados.\n",
122+
"</div>\n",
123+
"```\n",
124+
"\n",
125+
"\n",
126+
"<div class=\"alert alert-info\"\n",
127+
" style=\"color:#3c3c3c;background-color:#fd9df5;border-color:#9d6097\">\n",
128+
" <strong>¡Aviso!</strong> Este es un bloque con colores personalizados.\n",
129+
"</div>\n"
130+
]
131+
},
111132
{
112133
"cell_type": "code",
113134
"execution_count": 4,
@@ -174,140 +195,6 @@
174195
"\n",
175196
"2. Referencia bibliográfica 2."
176197
]
177-
},
178-
{
179-
"cell_type": "markdown",
180-
"metadata": {},
181-
"source": [
182-
"La siguiente celda cambia el formato del Notebook."
183-
]
184-
},
185-
{
186-
"cell_type": "code",
187-
"execution_count": 1,
188-
"metadata": {},
189-
"outputs": [
190-
{
191-
"data": {
192-
"text/html": [
193-
"\n",
194-
"<link href='http://fonts.googleapis.com/css?family=Fenix' rel='stylesheet' type='text/css'>\n",
195-
"<link href='http://fonts.googleapis.com/css?family=Alegreya+Sans:100,300,400,500,700,800,900,100italic,300italic,400italic,500italic,700italic,800italic,900italic' rel='stylesheet' type='text/css'>\n",
196-
"<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:300,400' rel='stylesheet' type='text/css'>\n",
197-
"\n",
198-
"<style>\n",
199-
"\n",
200-
"/*\n",
201-
"Template for Notebooks for Modelación computacional.\n",
202-
"\n",
203-
"Based on Lorena Barba template available at:\n",
204-
"\n",
205-
" https://github.com/barbagroup/AeroPython/blob/master/styles/custom.css\n",
206-
"*/\n",
207-
"\n",
208-
"/* Fonts */\n",
209-
"@font-face {\n",
210-
"font-family: \"Computer Modern\";\n",
211-
"src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');\n",
212-
"}\n",
213-
"\n",
214-
"/* Text */\n",
215-
"div.cell{\n",
216-
"width:800px;\n",
217-
"margin-left:16% !important;\n",
218-
"margin-right:auto;\n",
219-
"}\n",
220-
"h1 {\n",
221-
"font-family: 'Alegreya Sans', sans-serif;\n",
222-
"}\n",
223-
"h2 {\n",
224-
"font-family: 'Fenix', serif;\n",
225-
"}\n",
226-
"h3{\n",
227-
"font-family: 'Fenix', serif;\n",
228-
"margin-top:12px;\n",
229-
"margin-bottom: 3px;\n",
230-
"}\n",
231-
"h4{\n",
232-
"font-family: 'Fenix', serif;\n",
233-
"}\n",
234-
"h5 {\n",
235-
"font-family: 'Alegreya Sans', sans-serif;\n",
236-
"}\t\n",
237-
"div.text_cell_render{\n",
238-
"font-family: 'Alegreya Sans',Computer Modern, \"Helvetica Neue\", Arial, Helvetica, Geneva, sans-serif;\n",
239-
"line-height: 135%;\n",
240-
"font-size: 120%;\n",
241-
"width:600px;\n",
242-
"margin-left:auto;\n",
243-
"margin-right:auto;\n",
244-
"}\n",
245-
".CodeMirror{\n",
246-
"font-family: \"Source Code Pro\";\n",
247-
"font-size: 90%;\n",
248-
"}\n",
249-
"/* .prompt{\n",
250-
"display: None;\n",
251-
"}*/\n",
252-
".text_cell_render h1 {\n",
253-
"font-weight: 200;\n",
254-
"font-size: 50pt;\n",
255-
"line-height: 100%;\n",
256-
"color:#CD2305;\n",
257-
"margin-bottom: 0.5em;\n",
258-
"margin-top: 0.5em;\n",
259-
"display: block;\n",
260-
"}\t\n",
261-
".text_cell_render h5 {\n",
262-
"font-weight: 300;\n",
263-
"font-size: 16pt;\n",
264-
"color: #CD2305;\n",
265-
"font-style: italic;\n",
266-
"margin-bottom: .5em;\n",
267-
"margin-top: 0.5em;\n",
268-
"display: block;\n",
269-
"}\n",
270-
".warning{\n",
271-
"color: rgb( 240, 20, 20 )\n",
272-
"}\n",
273-
"</style>\n",
274-
"\n",
275-
"<script>\n",
276-
"/* Equations */\n",
277-
"\n",
278-
"MathJax.Hub.Config({\n",
279-
"TeX: {\n",
280-
"extensions: [\"AMSmath.js\"]\n",
281-
"},\n",
282-
"tex2jax: {\n",
283-
"inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
284-
"displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
285-
"},\n",
286-
"displayAlign: 'center', // Change this to 'center' to center equations.\n",
287-
"\"HTML-CSS\": {\n",
288-
"styles: {'.MathJax_Display': {\"margin\": 4}}\n",
289-
"}\n",
290-
"});\n",
291-
"</script>\n",
292-
"\n",
293-
"\n"
294-
],
295-
"text/plain": [
296-
"<IPython.core.display.HTML object>"
297-
]
298-
},
299-
"execution_count": 1,
300-
"metadata": {},
301-
"output_type": "execute_result"
302-
}
303-
],
304-
"source": [
305-
"from IPython.core.display import HTML\n",
306-
"def css_styling():\n",
307-
" styles = open('./nb_style.css', 'r').read()\n",
308-
" return HTML(styles)\n",
309-
"css_styling()"
310-
]
311198
}
312199
],
313200
"metadata": {
@@ -326,7 +213,7 @@
326213
"name": "python",
327214
"nbconvert_exporter": "python",
328215
"pygments_lexer": "ipython3",
329-
"version": "3.12.3"
216+
"version": "3.11.5"
330217
},
331218
"varInspector": {
332219
"cols": {

0 commit comments

Comments
 (0)